websauna.utils.jsonb module

JSONB data utilities.

websauna.utils.jsonb.complex_json_dumps(d)[source]

Dump JSON so that we handle decimal and dates.

Decimals are converted to strings.

websauna.utils.jsonb.is_index_property(obj, name)[source]

Check if an object property is index_property like.

This is needed to correctly generate Colander schema for index_property in SQLAlchemy models.

Return type:bool
websauna.utils.jsonb.sanitize_for_json(d)[source]

Get a JSON round trip for data.

This ensures we see data as it would be after JSON encode.

Return type:dict