artemis-model 0.1.132__py3-none-any.whl → 0.1.134__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.
- artemis_model/category.py +7 -13
- artemis_model/redis/zone_state.py +2 -2
- {artemis_model-0.1.132.dist-info → artemis_model-0.1.134.dist-info}/METADATA +1 -1
- {artemis_model-0.1.132.dist-info → artemis_model-0.1.134.dist-info}/RECORD +5 -5
- {artemis_model-0.1.132.dist-info → artemis_model-0.1.134.dist-info}/WHEEL +0 -0
artemis_model/category.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from sqlalchemy import
|
1
|
+
from sqlalchemy import Computed, String, func, literal, text
|
2
2
|
from sqlalchemy.ext.associationproxy import AssociationProxy, association_proxy
|
3
3
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
4
4
|
|
@@ -16,12 +16,12 @@ def to_tsvector_ix(*columns):
|
|
16
16
|
|
17
17
|
class CategoryMixin(TimeStampMixin):
|
18
18
|
id: Mapped[int] = mapped_column(primary_key=True)
|
19
|
-
|
20
|
-
|
19
|
+
main_category: Mapped[str] = mapped_column(nullable=False)
|
20
|
+
sub_category: Mapped[str] = mapped_column(nullable=False)
|
21
21
|
|
22
22
|
name_tsv = mapped_column(
|
23
23
|
TSVector(),
|
24
|
-
Computed("to_tsvector('english',
|
24
|
+
Computed("to_tsvector('english', main_category || ' ' || sub_category)", persisted=True),
|
25
25
|
)
|
26
26
|
|
27
27
|
@declared_attr
|
@@ -35,26 +35,20 @@ class CategoryMixin(TimeStampMixin):
|
|
35
35
|
"playlist",
|
36
36
|
creator=lambda p: PlaylistCategoryAssoc(playlist_id=p),
|
37
37
|
)
|
38
|
+
|
38
39
|
|
39
40
|
# __table_args__ = (
|
40
41
|
# Index(
|
41
42
|
# "fts_ix_category_name_tsv",
|
42
|
-
# to_tsvector_ix("
|
43
|
+
# to_tsvector_ix("main_category", "sub_category"),
|
43
44
|
# postgresql_using="gin",
|
44
45
|
# ),
|
45
46
|
# )
|
46
47
|
|
47
|
-
@property
|
48
|
-
def is_subcategory(self) -> bool:
|
49
|
-
if self.sub_categories:
|
50
|
-
return True
|
51
|
-
|
52
|
-
return False
|
53
|
-
|
54
48
|
|
55
49
|
class CategorySync(CustomSyncBase, CategoryMixin):
|
56
50
|
pass
|
57
51
|
|
58
52
|
|
59
53
|
class Category(CustomBase, CategoryMixin):
|
60
|
-
pass
|
54
|
+
pass
|
@@ -43,9 +43,9 @@ class PlaylistSimple(BaseModel):
|
|
43
43
|
class ScheduleDetails(BaseModel):
|
44
44
|
"""Schedule details schema."""
|
45
45
|
|
46
|
-
|
46
|
+
start_at: datetime | None = Field(
|
47
47
|
default=None,
|
48
|
-
description="The
|
48
|
+
description="The date and time value of the schedule in local timezone.",
|
49
49
|
)
|
50
50
|
playlists: list[PlaylistSimple] | None = Field(
|
51
51
|
default=None,
|
@@ -4,7 +4,7 @@ artemis_model/artist.py,sha256=vjXlFN2mOEidAzUzxmsAP5GnVTvJUuhFdhQaH214lgw,1563
|
|
4
4
|
artemis_model/auth.py,sha256=0Yg_6N1nj4U31F86u1PE0leIa3D64QlYrsDlavulN6s,4033
|
5
5
|
artemis_model/banned_tracks.py,sha256=uU-F-6DL2EshPAUwLTTHjYZ7UEz4vm0Wfcif2F0lSKw,664
|
6
6
|
artemis_model/base.py,sha256=zC20m8a1Sa11oEY0ay1iIRQeybGYvXY5p3Vr-pxoKnQ,6802
|
7
|
-
artemis_model/category.py,sha256=
|
7
|
+
artemis_model/category.py,sha256=HvBKLNI5J54UoM8e45ymDDhYFmiM4-zJwXez0TXepf8,1674
|
8
8
|
artemis_model/dj_set.py,sha256=fOYnCu4n5TiqyiSojfdFnO7LuPe_mM2SUwBV5xHy2Kc,3782
|
9
9
|
artemis_model/genre.py,sha256=8_-IuJS543wIhUVCES3bdrDpKPKx-plDuBKGBcoMIbc,1570
|
10
10
|
artemis_model/location.py,sha256=-ovGxYAajdQxNoQvafUBynSgcrdBklynXM7Qe7gmY5c,4645
|
@@ -18,7 +18,7 @@ artemis_model/redis/bucket.py,sha256=DlmIf6GxfKq9CzcXmMx5IcviaqOTvuWwIb6lAVcZQGs
|
|
18
18
|
artemis_model/redis/device.py,sha256=ZUiIyVmtWiEwayFIg9mktiFaVuHQ7Fg0rvSjjWyryCI,484
|
19
19
|
artemis_model/redis/keys.py,sha256=bnlSaBCIakLCIlgTr8BlYJmKEtKKvtdr43QIJCLnc90,567
|
20
20
|
artemis_model/redis/play_history.py,sha256=Jm0guS0UZDxfCXeWJ8vqcjjl93W_EeC7XcBXcclKPiE,1259
|
21
|
-
artemis_model/redis/zone_state.py,sha256=
|
21
|
+
artemis_model/redis/zone_state.py,sha256=BzXvKYaxc4DVjBiQ6ILdpv29CSrb249B1Gpi3Uye8fM,3514
|
22
22
|
artemis_model/schedule.py,sha256=CkLHWz-BwvUY2EQCfoU4SymgCariPzoQdtRLITqBPmk,2451
|
23
23
|
artemis_model/setting.py,sha256=EWzOmE31mLNWwmV_wmqttHPMycvQZW7SJUIozF2b8bo,1190
|
24
24
|
artemis_model/sqs/__init__.py,sha256=nHpXQns64qQ5Cqjyo6w9fDGO_wWhprqn1bhKf3eWnio,17
|
@@ -27,6 +27,6 @@ artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
|
|
27
27
|
artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
|
28
28
|
artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
|
29
29
|
artemis_model/zone_activity.py,sha256=BY4iODavY9ceJ5oRChdjjxf26S3U30Yb7Pxm5YRFpCo,1590
|
30
|
-
artemis_model-0.1.
|
31
|
-
artemis_model-0.1.
|
32
|
-
artemis_model-0.1.
|
30
|
+
artemis_model-0.1.134.dist-info/METADATA,sha256=RDzeS0msWjpXBAlMRQDMdy6X5KPwAZdbFn7DYGbC0iQ,3445
|
31
|
+
artemis_model-0.1.134.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
32
|
+
artemis_model-0.1.134.dist-info/RECORD,,
|
File without changes
|