API documentation¶
django_oapif.api.OAPIF ¶
Ninja API.
register ¶
register(model_class: type [Model ], /, id: str | None = None, title: str | None = None, description: str | None = None, geometry_field: str | None = 'geom', properties_fields: list [str ] | None = None, handler: type [QueryHandler ] = DjangoModelPermissionsOrAnonReadOnly ) -> None
Register a Django model in the API.
django_oapif.handler ¶
QueryHandler ¶
delete_model ¶
Given a model instance delete it from the database.
has_add_permission ¶
Returns True if the given request has permission to create objects in the collection, or a given object if defined.
has_change_permission ¶
Returns True if the given request has permission to change objects in the collection, or a given object if defined.
has_delete_permission ¶
Returns True if the given request has permission to delete objects in the collection, or a given object if defined.
has_view_permission ¶
Returns True if the given request has permission to view objects in the collection, or a given object if defined.
save_model ¶
Given a model instance save it to the database.
IsAuthenticated ¶
Bases:
Allows full access to authenticated users only.
IsAuthenticatedOrReadOnly ¶
Bases:
Allows full access to authenticated users only, but allows readonly access to everyone.
DjangoModelPermissions ¶
Bases:
Reuses all Django permissions for a given model.
DjangoModelPermissionsOrAnonReadOnly ¶
Bases:
Reuses all Django permissions for a given model, but allows readonly access to everyone.