Skip to content

Instances without a SQLAlchemy model

Thomas Pollet edited this page Apr 27, 2021 · 4 revisions

It's possible to implement jsonapi endpoints for objects that have no SQLAlchemy model. SAFRS was originally designed to reflect database objects. To expose objects that are not tied to a database, you should override some jsonapi properties in the object definition.

Example 1

small example without relationships

Example 2

The demo_stateless.py example demonstrates how to create an exposed object that is not based on an SQLAlchemy instance.