mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 21:59:58 -05:00
Consolidating deletion endpoints.
This commit is contained in:
parent
09a967535b
commit
ba63170e55
24 changed files with 309 additions and 320 deletions
|
|
@ -76,6 +76,10 @@ class Doc(ModelHelper, Base):
|
|||
d['data']['ebook_path'] = self.file_group.resolve_path(d['data']['ebook_path'])
|
||||
return d
|
||||
|
||||
@staticmethod
|
||||
def get_by_path(session: Session, path) -> Optional['Doc']:
|
||||
return session.query(Doc).join(FileGroup).filter(FileGroup.primary_path == str(path)).one_or_none()
|
||||
|
||||
@staticmethod
|
||||
def can_model(file_group: FileGroup) -> bool:
|
||||
if file_group.mimetype and mimetype_is_doc(file_group.mimetype):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue