artemis-model 0.1.156__tar.gz → 0.1.161__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.
- {artemis_model-0.1.156 → artemis_model-0.1.161}/PKG-INFO +1 -1
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/__init__.py +0 -1
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/organization.py +0 -15
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/redis/device.py +1 -1
- {artemis_model-0.1.156 → artemis_model-0.1.161}/pyproject.toml +1 -1
- artemis_model-0.1.156/artemis_model/approved_playlist_list.py +0 -59
- {artemis_model-0.1.156 → artemis_model-0.1.161}/README.md +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/album.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/artist.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/auth.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/banned_tracks.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/base.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/category.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/dj_set.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/genre.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/location.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/location_genre_exclusion.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/message.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/organization_include_pal_setting.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/otp.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/permission.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/playlist.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/redis/__init__.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/redis/bucket.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/redis/keys.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/redis/play_history.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/redis/zone_state.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/schedule.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/setting.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/sqs/__init__.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/sqs/messages.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/track.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/user.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/zone.py +0 -0
- {artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/zone_activity.py +0 -0
|
@@ -42,21 +42,6 @@ class OrganizationMixin(TimeStampMixin):
|
|
|
42
42
|
def include_pal_setting(cls) -> Mapped["OrganizationIncludePalSetting"]:
|
|
43
43
|
return relationship(back_populates="organization", uselist=False, cascade="all, delete-orphan")
|
|
44
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
|
|
59
|
-
|
|
60
45
|
|
|
61
46
|
def generate_slug(target: Any, value: Any, old_value: Any, initiator: Any) -> None:
|
|
62
47
|
"""Creates a reasonable slug based on organization name."""
|
|
@@ -13,7 +13,7 @@ class ActiveDevice(BaseModel):
|
|
|
13
13
|
user_id: UUID
|
|
14
14
|
client_id: str
|
|
15
15
|
device_id: str
|
|
16
|
-
mode: Literal["player-mode", "controller-mode"]
|
|
16
|
+
mode: Literal["player-mode", "controller-mode", "force-player-mode"]
|
|
17
17
|
connected_at: datetime | str = Field(
|
|
18
18
|
default_factory=lambda: datetime.now(timezone.utc).isoformat()
|
|
19
19
|
)
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{artemis_model-0.1.156 → artemis_model-0.1.161}/artemis_model/organization_include_pal_setting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|