artemis-model 0.1.154__py3-none-any.whl → 0.1.156__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
@@ -1,4 +1,5 @@
1
1
  from artemis_model.album import * # noqa
2
+ from artemis_model.approved_playlist_list import * # noqa
2
3
  from artemis_model.artist import * # noqa
3
4
  from artemis_model.auth import * # noqa
4
5
  from artemis_model.category import * # noqa
@@ -8,6 +9,7 @@ from artemis_model.location import * # noqa
8
9
  from artemis_model.location_genre_exclusion import * # noqa
9
10
  from artemis_model.message import * # noqa
10
11
  from artemis_model.organization import * # noqa
12
+ from artemis_model.organization_include_pal_setting import * # noqa
11
13
  from artemis_model.playlist import * # noqa
12
14
  from artemis_model.schedule import * # noqa
13
15
  from artemis_model.setting import * # noqa
@@ -0,0 +1,59 @@
1
+ import uuid
2
+ from typing import List
3
+
4
+ from sqlalchemy import ForeignKey
5
+ from sqlalchemy.orm import Mapped, mapped_column, relationship
6
+ from sqlalchemy.ext.declarative import declared_attr
7
+
8
+ from artemis_model.base import CustomSyncBase, TimeStampMixin, AuditMixin, CustomBase
9
+
10
+
11
+ class ApprovedPlaylistListMixin(TimeStampMixin, AuditMixin):
12
+
13
+ id: Mapped[int] = mapped_column(autoincrement=True, primary_key=True, index=True)
14
+ name: Mapped[str] = mapped_column(nullable=False)
15
+ organization_id: Mapped[uuid.UUID] = mapped_column(
16
+ ForeignKey("organization.id"), nullable=False, index=True
17
+ )
18
+
19
+ @declared_attr
20
+ def organization(cls) -> Mapped["Organization"]:
21
+ return relationship("Organization", back_populates="approved_playlist_lists")
22
+
23
+ @declared_attr
24
+ def playlist_associations(cls) -> Mapped[List["ApprovedPlaylistListPlaylistAssoc"]]:
25
+ return relationship(cascade="all, delete-orphan")
26
+
27
+ @declared_attr
28
+ def playlists(cls) -> Mapped[List["Playlist"]]:
29
+ return relationship(
30
+ "Playlist",
31
+ secondary="approved_playlist_list_playlist_assoc",
32
+ viewonly=True
33
+ )
34
+
35
+
36
+ class ApprovedPlaylistListSync(CustomSyncBase, ApprovedPlaylistListMixin):
37
+ pass
38
+
39
+
40
+ class ApprovedPlaylistList(CustomBase, ApprovedPlaylistListMixin):
41
+ pass
42
+
43
+
44
+ class ApprovedPlaylistListPlaylistAssocMixin(TimeStampMixin):
45
+
46
+ approved_playlist_list_id: Mapped[int] = mapped_column(
47
+ ForeignKey("approved_playlist_list.id"), primary_key=True, nullable=False
48
+ )
49
+ playlist_id: Mapped[int] = mapped_column(
50
+ ForeignKey("playlist.id"), primary_key=True, nullable=False
51
+ )
52
+
53
+
54
+ class ApprovedPlaylistListPlaylistAssocSync(CustomSyncBase, ApprovedPlaylistListPlaylistAssocMixin):
55
+ pass
56
+
57
+
58
+ class ApprovedPlaylistListPlaylistAssoc(CustomBase, ApprovedPlaylistListPlaylistAssocMixin):
59
+ pass
@@ -37,6 +37,25 @@ class OrganizationMixin(TimeStampMixin):
37
37
  @declared_attr
38
38
  def message_groups(cls) -> Mapped[List["MessageGroup"]]:
39
39
  return relationship(back_populates="organization")
40
+
41
+ @declared_attr
42
+ def include_pal_setting(cls) -> Mapped["OrganizationIncludePalSetting"]:
43
+ return relationship(back_populates="organization", uselist=False, cascade="all, delete-orphan")
44
+
45
+ @declared_attr
46
+ def approved_playlist_lists(cls) -> Mapped[List["ApprovedPlaylistList"]]:
47
+ return relationship("ApprovedPlaylistList", back_populates="organization")
48
+
49
+ @property
50
+ def approved_playlists(self) -> List[int]:
51
+ """
52
+ Convenience property to get all playlist IDs from all approved lists, flattened.
53
+ Returns empty list if no approved lists exist.
54
+ """
55
+ playlist_ids = []
56
+ for approved_list in self.approved_playlist_lists:
57
+ playlist_ids.extend([playlist.id for playlist in approved_list.playlists])
58
+ return playlist_ids
40
59
 
41
60
 
42
61
  def generate_slug(target: Any, value: Any, old_value: Any, initiator: Any) -> None:
@@ -0,0 +1,34 @@
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 OrganizationIncludePalSettingMixin(TimeStampMixin):
10
+ """Organization-level setting for including parental advisory (explicit) content."""
11
+
12
+ id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
13
+ organization_id: Mapped[uuid.UUID] = mapped_column(
14
+ ForeignKey("organization.id", ondelete="CASCADE"), nullable=False, index=True
15
+ )
16
+ include_pal: Mapped[bool] = mapped_column(
17
+ nullable=False, default=False
18
+ )
19
+
20
+ @declared_attr
21
+ def organization(cls) -> Mapped["Organization"]:
22
+ return relationship(back_populates="include_pal_setting")
23
+
24
+ __table_args__ = (
25
+ UniqueConstraint("organization_id", name="unique_organization_include_pal_setting"),
26
+ )
27
+
28
+
29
+ class OrganizationIncludePalSettingSync(CustomSyncBase, OrganizationIncludePalSettingMixin):
30
+ pass
31
+
32
+
33
+ class OrganizationIncludePalSetting(CustomBase, OrganizationIncludePalSettingMixin):
34
+ pass
artemis_model/setting.py CHANGED
@@ -25,7 +25,7 @@ class SettingMixin(TimeStampMixin):
25
25
  "<track_id>": "<track_name>",
26
26
  ...
27
27
  },
28
- "exclude_pal": True/False
28
+ "include_pal": True/False
29
29
  }
30
30
  """
31
31
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: artemis-model
3
- Version: 0.1.154
3
+ Version: 0.1.156
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -8,6 +8,7 @@ Classifier: Programming Language :: Python :: 3
8
8
  Classifier: Programming Language :: Python :: 3.11
9
9
  Classifier: Programming Language :: Python :: 3.12
10
10
  Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Programming Language :: Python :: 3.14
11
12
  Requires-Dist: alembic (>=1.13.1,<2.0.0)
12
13
  Requires-Dist: asyncpg (>=0.30.0,<0.31.0)
13
14
  Requires-Dist: greenlet (>=3.0.2,<4.0.0)
@@ -1,5 +1,6 @@
1
- artemis_model/__init__.py,sha256=Ejibc6nk_vwWCPqRZirhof2Y2t-zeaYvOWyXJLUZsTg,853
1
+ artemis_model/__init__.py,sha256=R__YcDg7FMAMHyy9CVjqi6fC58DEWkwMXCg0S9Az6Ck,981
2
2
  artemis_model/album.py,sha256=9uw9HVNHVBjl-0Dgv-o5MHXhUPwedvbnbzzY3A1cKQg,2077
3
+ artemis_model/approved_playlist_list.py,sha256=JJ2n15JA7kBbsKrQA-GpfriMEjCHZmWcFhFAKfNcPxY,1869
3
4
  artemis_model/artist.py,sha256=vjXlFN2mOEidAzUzxmsAP5GnVTvJUuhFdhQaH214lgw,1563
4
5
  artemis_model/auth.py,sha256=0Yg_6N1nj4U31F86u1PE0leIa3D64QlYrsDlavulN6s,4033
5
6
  artemis_model/banned_tracks.py,sha256=uU-F-6DL2EshPAUwLTTHjYZ7UEz4vm0Wfcif2F0lSKw,664
@@ -10,7 +11,8 @@ artemis_model/genre.py,sha256=8_-IuJS543wIhUVCES3bdrDpKPKx-plDuBKGBcoMIbc,1570
10
11
  artemis_model/location.py,sha256=6Z99OCxhB3VQ4CqNwZP3ShnJ-gOnc5rxGnCn5aCIFZ8,4896
11
12
  artemis_model/location_genre_exclusion.py,sha256=SMX4TXmpwn28tytUq7-qP9ZyJ_ULs5SUv4h7sU0dRFo,1252
12
13
  artemis_model/message.py,sha256=W4vhllsD4Nn11JIKeXlgsKC2NWCt3UMkWh-Sma71gBI,3325
13
- artemis_model/organization.py,sha256=yjGHJLTOtb9PUfxSPal782Rceb8xb8vftXX67tHRNqc,2351
14
+ artemis_model/organization.py,sha256=oyq8YIqVr5HAli1IuqFj2UlVKw9KBpWIMlZGcEzmYyA,3167
15
+ artemis_model/organization_include_pal_setting.py,sha256=OhNRn4aH96IquJcJBsubvZEgIY3ENqPr4Rda4GWEZ1g,1179
14
16
  artemis_model/otp.py,sha256=guIRGtyFlHUBthCAEsTh5_Hs-1yiGN_qfEO4uHNcv4s,1017
15
17
  artemis_model/permission.py,sha256=Bn1Bg1aCS4Z4_3tqEqvtrzqAYDCImsvmGyIEMoVycEk,1452
16
18
  artemis_model/playlist.py,sha256=O60zlP1LrDkzNrrfNA7TD_kotd5A9i8PuFhwonXFhN0,6559
@@ -21,13 +23,13 @@ artemis_model/redis/keys.py,sha256=IdYexbBfBJR9AGtKB5SXFl1fxVY16yYmUXE-feYYT84,6
21
23
  artemis_model/redis/play_history.py,sha256=Jm0guS0UZDxfCXeWJ8vqcjjl93W_EeC7XcBXcclKPiE,1259
22
24
  artemis_model/redis/zone_state.py,sha256=A5z2ss1-zq6_UHavs6mBgxsllXLz5hYbKCNRAjD-ONw,3152
23
25
  artemis_model/schedule.py,sha256=CkLHWz-BwvUY2EQCfoU4SymgCariPzoQdtRLITqBPmk,2451
24
- artemis_model/setting.py,sha256=EWzOmE31mLNWwmV_wmqttHPMycvQZW7SJUIozF2b8bo,1190
26
+ artemis_model/setting.py,sha256=xe5SHDziY8RzFxzB1GzousxI1FXYhyXZ5proEseS60g,1190
25
27
  artemis_model/sqs/__init__.py,sha256=nHpXQns64qQ5Cqjyo6w9fDGO_wWhprqn1bhKf3eWnio,17
26
28
  artemis_model/sqs/messages.py,sha256=2TVlSQJzF2phblQGrlUWdQ8Uw-kJstnGtcbY06MIBWM,2852
27
29
  artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
28
30
  artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
29
31
  artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
30
32
  artemis_model/zone_activity.py,sha256=BY4iODavY9ceJ5oRChdjjxf26S3U30Yb7Pxm5YRFpCo,1590
31
- artemis_model-0.1.154.dist-info/METADATA,sha256=bxHAkb-zosaUixgP7x0t5vdkqWK1ax2UknnuhKiUPc0,3445
32
- artemis_model-0.1.154.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
33
- artemis_model-0.1.154.dist-info/RECORD,,
33
+ artemis_model-0.1.156.dist-info/METADATA,sha256=W7-Dbr6jmhszilJVX1J9N5ACS2Ll8q_6DfobTFqhSu4,3496
34
+ artemis_model-0.1.156.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
35
+ artemis_model-0.1.156.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any