mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-07 03:35:24 +00:00
feat(folder): only list default folders
This commit is contained in:
parent
4ca2aca293
commit
4e7ff91e0c
@ -33,7 +33,10 @@ class LibraryModel(Base):
|
|||||||
__tablename__ = "libraries"
|
__tablename__ = "libraries"
|
||||||
name: Mapped[str] = mapped_column(String, nullable=False, unique=True)
|
name: Mapped[str] = mapped_column(String, nullable=False, unique=True)
|
||||||
folders: Mapped[List["FolderModel"]] = relationship(
|
folders: Mapped[List["FolderModel"]] = relationship(
|
||||||
"FolderModel", back_populates="library", lazy="joined"
|
"FolderModel",
|
||||||
|
back_populates="library",
|
||||||
|
lazy="joined",
|
||||||
|
primaryjoin="and_(LibraryModel.id==FolderModel.library_id, FolderModel.type=='default')",
|
||||||
)
|
)
|
||||||
plugins: Mapped[List["PluginModel"]] = relationship(
|
plugins: Mapped[List["PluginModel"]] = relationship(
|
||||||
"PluginModel", secondary="library_plugins", lazy="joined"
|
"PluginModel", secondary="library_plugins", lazy="joined"
|
||||||
@ -52,12 +55,8 @@ class FolderModel(Base):
|
|||||||
entities: Mapped[List["EntityModel"]] = relationship(
|
entities: Mapped[List["EntityModel"]] = relationship(
|
||||||
"EntityModel", back_populates="folder"
|
"EntityModel", back_populates="folder"
|
||||||
)
|
)
|
||||||
type: Mapped[FolderType] = mapped_column(
|
type: Mapped[FolderType] = mapped_column(Enum(FolderType), nullable=False)
|
||||||
Enum(FolderType), nullable=False
|
last_modified_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=False)
|
||||||
)
|
|
||||||
last_modified_at: Mapped[datetime | None] = mapped_column(
|
|
||||||
DateTime, nullable=False
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class EntityModel(Base):
|
class EntityModel(Base):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user