artemis-model 0.1.137__py3-none-any.whl → 0.1.139__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 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,42 @@
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"),
15
+ nullable=False,
16
+ index=True
17
+ )
18
+ genre_id: Mapped[int] = mapped_column(
19
+ ForeignKey("genre.id", ondelete="CASCADE"),
20
+ nullable=False,
21
+ index=True
22
+ )
23
+
24
+ @declared_attr
25
+ def location(cls) -> Mapped["Location"]:
26
+ return relationship("Location", back_populates="genre_exclusions")
27
+
28
+ @declared_attr
29
+ def genre(cls) -> Mapped["Genre"]:
30
+ return relationship("Genre")
31
+
32
+ __table_args__ = (
33
+ UniqueConstraint('location_id', 'genre_id', name='unique_location_genre_exclusion'),
34
+ )
35
+
36
+
37
+ class LocationGenreExclusionSync(CustomSyncBase, LocationGenreExclusionMixin):
38
+ pass
39
+
40
+
41
+ class LocationGenreExclusion(CustomBase, LocationGenreExclusionMixin):
42
+ pass
@@ -88,7 +88,7 @@ class RefreshTrackBucketIn(BaseMessage):
88
88
 
89
89
  action: Action = Action.REFRESH_TRACK_BUCKET
90
90
  zone_id: int
91
- bucket_id: BucketId
91
+ bucket_key: str
92
92
 
93
93
 
94
94
  class RecalculateScheduleIn(BaseMessage):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: artemis-model
3
- Version: 0.1.137
3
+ Version: 0.1.139
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -1,4 +1,4 @@
1
- artemis_model/__init__.py,sha256=zEeAUndIbJdp_M6pFlON_BEehnMaMcTvusijGktpnvk,792
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=-ovGxYAajdQxNoQvafUBynSgcrdBklynXM7Qe7gmY5c,4645
10
+ artemis_model/location.py,sha256=6Z99OCxhB3VQ4CqNwZP3ShnJ-gOnc5rxGnCn5aCIFZ8,4896
11
+ artemis_model/location_genre_exclusion.py,sha256=6UCsA6ODh6gfJ6qPiuVAsQq9CR8Ei1J5i8CUJ4XwcNU,1314
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
@@ -22,11 +23,11 @@ artemis_model/redis/zone_state.py,sha256=BzXvKYaxc4DVjBiQ6ILdpv29CSrb249B1Gpi3Uy
22
23
  artemis_model/schedule.py,sha256=CkLHWz-BwvUY2EQCfoU4SymgCariPzoQdtRLITqBPmk,2451
23
24
  artemis_model/setting.py,sha256=EWzOmE31mLNWwmV_wmqttHPMycvQZW7SJUIozF2b8bo,1190
24
25
  artemis_model/sqs/__init__.py,sha256=nHpXQns64qQ5Cqjyo6w9fDGO_wWhprqn1bhKf3eWnio,17
25
- artemis_model/sqs/messages.py,sha256=96Va8Fmz_n_qgUp9Og9MTNn16TMo1Xv2VFChVo9AZA8,2993
26
+ artemis_model/sqs/messages.py,sha256=_5iKo6kqnrI2lIwWaKZV57knEugt1boW2FESP186EQw,2989
26
27
  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.137.dist-info/METADATA,sha256=N0UfGXIHyMxocPaUHV6Vn1GwMTNSvCzzw6LUyQ0xHPE,3445
31
- artemis_model-0.1.137.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- artemis_model-0.1.137.dist-info/RECORD,,
31
+ artemis_model-0.1.139.dist-info/METADATA,sha256=bKeFejZx9E-ZS5nam57c-QVPxuBQ3c9kPOlpTZmnNic,3445
32
+ artemis_model-0.1.139.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
33
+ artemis_model-0.1.139.dist-info/RECORD,,