✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

Model


reflex.model.Model
Base class to define a table in the database.

Class Fields


FieldDescription

Fields


FieldDescription
id The primary key for the table.

Methods


SignatureDescription
dict(self, **kwargs)Convert the object to a dictionary.
create_all()Create all the tables.
get_db_engine()Get the database engine.
_alembic_config()Get the alembic configuration and script_directory.
_alembic_render_item(type_: 'str', obj: 'Any', autogen_context: "'alembic.autogenerate.api.AutogenContext'")Alembic render_item hook call. This method is called to provide python code for the given obj, but currently it is only used to add `sqlmodel` to the import list when generating migration scripts. See https://alembic.sqlalchemy.org/en/latest/api/runtime.html
← EventSpecMiddleware →

Copyright © 2023 Pynecone, Inc.