"""SQLAlchemy ORM models. Importing this package registers every model on ``Base.metadata``, which is what ``alembic revision --autogenerate`` inspects. A new model therefore has to be added to the imports below, not only to its own module. The import order here is for readability only: relationships are declared by name and resolved through the SQLAlchemy registry after every module has been imported, so a cycle between two model modules is not a problem. Table naming ------------ Every table is prefixed with the module it belongs to, and a class is named after its table (``Template`` -> ``template``): template the 模板 module template_field a field placed in a template, with its position template_field_library the 字段库 the template module draws on paper the 论文 module paper_sentence one sentence of one paper paper_sentence_reference a citation of one sentence ``template_field`` and ``template_field_library`` are one word apart and mean opposite things: the first is a *placement* (this template puts this field here, ``sort`` included), the second is the *catalogue* it was picked from. """ from app.models.mixins import TimestampMixin from app.models.paper import ( PAPER_STATUSES, STATUS_DONE, STATUS_DRAFT, STATUS_WRITING, Paper, ) from app.models.paper_sentence import PaperSentence from app.models.paper_sentence_reference import PaperSentenceReference from app.models.template import Template from app.models.template_field import TemplateField from app.models.template_field_library import TemplateFieldLibrary __all__ = [ "PAPER_STATUSES", "STATUS_DONE", "STATUS_DRAFT", "STATUS_WRITING", "Paper", "PaperSentence", "PaperSentenceReference", "Template", "TemplateField", "TemplateFieldLibrary", "TimestampMixin", ]