mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
20 lines
567 B
Python
20 lines
567 B
Python
from time import strftime
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from database.database import Database, EntityCRUD
|
|
|
|
from .. import models as mdl
|
|
from .. import schemas as sch
|
|
|
|
|
|
class MovieGenresCRUD(EntityCRUD[mdl.MovieGenre]):
|
|
@staticmethod
|
|
async def get_all(db: AsyncSession):
|
|
return await Database.get_all(db, mdl.MovieGenre)
|
|
|
|
@staticmethod
|
|
async def add(db: AsyncSession,
|
|
info: sch.MovieGenreCreate):
|
|
movie_genre = mdl.MovieGenre(**info.model_dump())
|
|
return await Database.add(db, movie_genre)
|