start porting: playlists endpoints

This commit is contained in:
cwilvx
2024-07-01 09:22:52 +03:00
parent a3c4558d52
commit ff7343a7be
5 changed files with 196 additions and 62 deletions
+4
View File
@@ -78,6 +78,10 @@ class Base(MappedAsDataclass, DeclarativeBase):
with DbManager(commit=True) as conn:
conn.execute(delete(cls))
@classmethod
def remove_one(cls, id: int):
cls.execute(delete(cls).where(cls.id == id), commit=True)
@classmethod
def all(cls):
return cls.execute(select(cls))