geonature.utils.json¶
Classes¶
Provide JSON operations using Python's built-in |
Functions¶
|
Context manager to set the pagination schema for a given model. |
Module Contents¶
- geonature.utils.json.pagination_schema(schema)[source]¶
Context manager to set the pagination schema for a given model.
Parameters¶
schema : Model schema to use for pagination.
Notes¶
- Usage:
- with pagination_schema(UserSchema):
return jsonify(pagination)
- class geonature.utils.json.MyJSONProvider(app: flask.sansio.app.App)[source]¶
Bases:
flask.json.provider.DefaultJSONProviderProvide JSON operations using Python’s built-in
jsonlibrary. Serializes the following additional data types:datetime.datetimeanddatetime.dateare serialized to RFC 822 strings. This is the same as the HTTP date format.uuid.UUIDis serialized to a string.dataclasses.dataclassis passed todataclasses.asdict().Markup(or any object with a__html__method) will call the__html__method to get a string.