pretalx_client.adapters.normalization¶
Normalization helpers for Pretalx multilingual and ID-based fields.
Pretalx returns localized fields as either plain strings or dicts keyed by
language code (e.g. {"en": "Talk", "de": "Vortrag"}). It also returns
foreign-key fields as integer IDs in the real API but as inline objects in
the public/legacy API. These helpers normalize both patterns into plain
Python strings.
Functions
|
Extract a display string from a Pretalx multilingual field. |
|
Resolve a Pretalx field that may be an integer ID or a localized value. |
|
Resolve a list of Pretalx ID/localized values into display strings. |
- pretalx_client.adapters.normalization.localized(value)[source]¶
Extract a display string from a Pretalx multilingual field.
Pretalx returns localized fields as either a plain string or a dict keyed by language code (e.g.
{"en": "Talk", "de": "Vortrag"}). This helper returns theenvalue when available, falling back to the first available language, or an empty string forNone.
- pretalx_client.adapters.normalization.resolve_id_or_localized(value, mapping=None)[source]¶
Resolve a Pretalx field that may be an integer ID or a localized value.
When the real API returns an integer ID (e.g. for
submission_type,track, orroom), the optional mapping dict is used to look up the human-readable name. Falls back tolocalized()for string/dict values, orstr(value)for unmapped integers.