feat(stream): add Stream model for managing streaming service links to sounds; update Sound model to include relationship with Stream
This commit is contained in:
@@ -12,6 +12,7 @@ from app.database import db
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from app.models.playlist_sound import PlaylistSound
|
||||
from app.models.stream import Stream
|
||||
|
||||
|
||||
class SoundType(Enum):
|
||||
@@ -96,6 +97,11 @@ class Sound(db.Model):
|
||||
back_populates="sound",
|
||||
cascade="all, delete-orphan",
|
||||
)
|
||||
streams: Mapped[list["Stream"]] = relationship(
|
||||
"Stream",
|
||||
back_populates="sound",
|
||||
cascade="all, delete-orphan",
|
||||
)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
"""String representation of Sound."""
|
||||
|
||||
Reference in New Issue
Block a user