artemis-model 0.1.138__tar.gz → 0.1.139__tar.gz

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.

Files changed (33) hide show
  1. {artemis_model-0.1.138 → artemis_model-0.1.139}/PKG-INFO +1 -1
  2. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/__init__.py +1 -0
  3. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/location.py +8 -0
  4. artemis_model-0.1.139/artemis_model/location_genre_exclusion.py +42 -0
  5. {artemis_model-0.1.138 → artemis_model-0.1.139}/pyproject.toml +1 -1
  6. {artemis_model-0.1.138 → artemis_model-0.1.139}/README.md +0 -0
  7. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/album.py +0 -0
  8. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/artist.py +0 -0
  9. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/auth.py +0 -0
  10. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/banned_tracks.py +0 -0
  11. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/base.py +0 -0
  12. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/category.py +0 -0
  13. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/dj_set.py +0 -0
  14. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/genre.py +0 -0
  15. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/message.py +0 -0
  16. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/organization.py +0 -0
  17. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/otp.py +0 -0
  18. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/permission.py +0 -0
  19. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/playlist.py +0 -0
  20. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/redis/__init__.py +0 -0
  21. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/redis/bucket.py +0 -0
  22. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/redis/device.py +0 -0
  23. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/redis/keys.py +0 -0
  24. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/redis/play_history.py +0 -0
  25. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/redis/zone_state.py +0 -0
  26. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/schedule.py +0 -0
  27. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/setting.py +0 -0
  28. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/sqs/__init__.py +0 -0
  29. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/sqs/messages.py +0 -0
  30. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/track.py +0 -0
  31. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/user.py +0 -0
  32. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/zone.py +0 -0
  33. {artemis_model-0.1.138 → artemis_model-0.1.139}/artemis_model/zone_activity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: artemis-model
3
- Version: 0.1.138
3
+ Version: 0.1.139
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -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
@@ -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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "artemis-model"
3
- version = "0.1.138"
3
+ version = "0.1.139"
4
4
  description = ""
5
5
  authors = ["Jukeboxy"]
6
6
  readme = "README.md"