artemis-model 0.1.147__py3-none-any.whl → 0.1.148__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of artemis-model might be problematic. Click here for more details.
- artemis_model/__init__.py +1 -0
- artemis_model/location.py +8 -0
- artemis_model/location_genre_exclusion.py +38 -0
- {artemis_model-0.1.147.dist-info → artemis_model-0.1.148.dist-info}/METADATA +1 -1
- {artemis_model-0.1.147.dist-info → artemis_model-0.1.148.dist-info}/RECORD +6 -5
- {artemis_model-0.1.147.dist-info → artemis_model-0.1.148.dist-info}/WHEEL +0 -0
artemis_model/__init__.py
CHANGED
|
@@ -5,6 +5,7 @@ from artemis_model.category import * # noqa
|
|
|
5
5
|
from artemis_model.dj_set import * # noqa
|
|
6
6
|
from artemis_model.genre import * # noqa
|
|
7
7
|
from artemis_model.location import * # noqa
|
|
8
|
+
from artemis_model.location_genre_exclusion import * # noqa
|
|
8
9
|
from artemis_model.message import * # noqa
|
|
9
10
|
from artemis_model.organization import * # noqa
|
|
10
11
|
from artemis_model.playlist import * # noqa
|
artemis_model/location.py
CHANGED
|
@@ -86,6 +86,14 @@ class LocationMixin(TimeStampMixin):
|
|
|
86
86
|
cascade="all, delete-orphan",
|
|
87
87
|
)
|
|
88
88
|
|
|
89
|
+
@declared_attr
|
|
90
|
+
def genre_exclusions(cls) -> Mapped[list["LocationGenreExclusion"]]:
|
|
91
|
+
return relationship(
|
|
92
|
+
"LocationGenreExclusion",
|
|
93
|
+
back_populates="location",
|
|
94
|
+
cascade="all, delete-orphan",
|
|
95
|
+
)
|
|
96
|
+
|
|
89
97
|
timezone: Mapped[str] = mapped_column(nullable=False, default="America/New_York")
|
|
90
98
|
|
|
91
99
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
from sqlalchemy import ForeignKey, UniqueConstraint
|
|
3
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
4
|
+
from sqlalchemy.ext.declarative import declared_attr
|
|
5
|
+
|
|
6
|
+
from artemis_model.base import TimeStampMixin, CustomSyncBase, CustomBase
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class LocationGenreExclusionMixin(TimeStampMixin):
|
|
10
|
+
"""Association table for tracking which genres are excluded at the location level."""
|
|
11
|
+
|
|
12
|
+
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
|
13
|
+
location_id: Mapped[uuid.UUID] = mapped_column(
|
|
14
|
+
ForeignKey("location.id", ondelete="CASCADE"), nullable=False, index=True
|
|
15
|
+
)
|
|
16
|
+
genre_id: Mapped[int] = mapped_column(
|
|
17
|
+
ForeignKey("genre.id", ondelete="CASCADE"), nullable=False, index=True
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
@declared_attr
|
|
21
|
+
def location(cls) -> Mapped["Location"]:
|
|
22
|
+
return relationship(back_populates="genre_exclusions")
|
|
23
|
+
|
|
24
|
+
@declared_attr
|
|
25
|
+
def genre(cls) -> Mapped["Genre"]:
|
|
26
|
+
return relationship()
|
|
27
|
+
|
|
28
|
+
__table_args__ = (
|
|
29
|
+
UniqueConstraint("location_id", "genre_id", name="unique_location_genre_exclusion"),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class LocationGenreExclusionSync(CustomSyncBase, LocationGenreExclusionMixin):
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class LocationGenreExclusion(CustomBase, LocationGenreExclusionMixin):
|
|
38
|
+
pass
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
artemis_model/__init__.py,sha256=
|
|
1
|
+
artemis_model/__init__.py,sha256=Ejibc6nk_vwWCPqRZirhof2Y2t-zeaYvOWyXJLUZsTg,853
|
|
2
2
|
artemis_model/album.py,sha256=9uw9HVNHVBjl-0Dgv-o5MHXhUPwedvbnbzzY3A1cKQg,2077
|
|
3
3
|
artemis_model/artist.py,sha256=vjXlFN2mOEidAzUzxmsAP5GnVTvJUuhFdhQaH214lgw,1563
|
|
4
4
|
artemis_model/auth.py,sha256=0Yg_6N1nj4U31F86u1PE0leIa3D64QlYrsDlavulN6s,4033
|
|
@@ -7,7 +7,8 @@ artemis_model/base.py,sha256=zC20m8a1Sa11oEY0ay1iIRQeybGYvXY5p3Vr-pxoKnQ,6802
|
|
|
7
7
|
artemis_model/category.py,sha256=ERZC8YBTtmF72ykSiVEtf_Ws3mPuN28ECfTxWF7H8tE,1662
|
|
8
8
|
artemis_model/dj_set.py,sha256=fOYnCu4n5TiqyiSojfdFnO7LuPe_mM2SUwBV5xHy2Kc,3782
|
|
9
9
|
artemis_model/genre.py,sha256=8_-IuJS543wIhUVCES3bdrDpKPKx-plDuBKGBcoMIbc,1570
|
|
10
|
-
artemis_model/location.py,sha256
|
|
10
|
+
artemis_model/location.py,sha256=6Z99OCxhB3VQ4CqNwZP3ShnJ-gOnc5rxGnCn5aCIFZ8,4896
|
|
11
|
+
artemis_model/location_genre_exclusion.py,sha256=SMX4TXmpwn28tytUq7-qP9ZyJ_ULs5SUv4h7sU0dRFo,1252
|
|
11
12
|
artemis_model/message.py,sha256=W4vhllsD4Nn11JIKeXlgsKC2NWCt3UMkWh-Sma71gBI,3325
|
|
12
13
|
artemis_model/organization.py,sha256=yjGHJLTOtb9PUfxSPal782Rceb8xb8vftXX67tHRNqc,2351
|
|
13
14
|
artemis_model/otp.py,sha256=guIRGtyFlHUBthCAEsTh5_Hs-1yiGN_qfEO4uHNcv4s,1017
|
|
@@ -27,6 +28,6 @@ artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
|
|
|
27
28
|
artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
|
|
28
29
|
artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
|
|
29
30
|
artemis_model/zone_activity.py,sha256=BY4iODavY9ceJ5oRChdjjxf26S3U30Yb7Pxm5YRFpCo,1590
|
|
30
|
-
artemis_model-0.1.
|
|
31
|
-
artemis_model-0.1.
|
|
32
|
-
artemis_model-0.1.
|
|
31
|
+
artemis_model-0.1.148.dist-info/METADATA,sha256=rzxZwL6haqnmDmoARazFKxNkJ9hqnccEWmbV2Sf09sc,3445
|
|
32
|
+
artemis_model-0.1.148.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
33
|
+
artemis_model-0.1.148.dist-info/RECORD,,
|
|
File without changes
|