cs-models 0.0.571__py3-none-any.whl → 0.0.573__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 cs-models might be problematic. Click here for more details.
- cs_models/resources/UserWatchlist/__init__.py +0 -0
- cs_models/resources/UserWatchlist/models.py +33 -0
- cs_models/resources/UserWatchlist/schemas.py +17 -0
- {cs_models-0.0.571.dist-info → cs_models-0.0.573.dist-info}/METADATA +1 -1
- {cs_models-0.0.571.dist-info → cs_models-0.0.573.dist-info}/RECORD +7 -4
- {cs_models-0.0.571.dist-info → cs_models-0.0.573.dist-info}/WHEEL +0 -0
- {cs_models-0.0.571.dist-info → cs_models-0.0.573.dist-info}/top_level.txt +0 -0
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from sqlalchemy import (
|
|
2
|
+
Column,
|
|
3
|
+
Integer,
|
|
4
|
+
String,
|
|
5
|
+
DateTime,
|
|
6
|
+
Boolean,
|
|
7
|
+
ForeignKey,
|
|
8
|
+
)
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
|
|
11
|
+
from ...database import Base
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class UserWatchlistModel(Base):
|
|
15
|
+
__tablename__ = 'user_watchlists'
|
|
16
|
+
|
|
17
|
+
id = Column(Integer, primary_key=True)
|
|
18
|
+
user_id = Column(String(128), nullable=False)
|
|
19
|
+
resource_type = Column(String(128), nullable=False, index=True)
|
|
20
|
+
resource_id = Column(String(50), nullable=False, index=True)
|
|
21
|
+
is_active = Column(Boolean, nullable=True)
|
|
22
|
+
saved_search_id = Column(
|
|
23
|
+
Integer,
|
|
24
|
+
ForeignKey('user_saved_searches.id'),
|
|
25
|
+
nullable=False,
|
|
26
|
+
)
|
|
27
|
+
updated_at = Column(
|
|
28
|
+
DateTime,
|
|
29
|
+
nullable=False,
|
|
30
|
+
# https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
|
|
31
|
+
default=lambda: datetime.utcnow(),
|
|
32
|
+
onupdate=lambda: datetime.utcnow(),
|
|
33
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from marshmallow import (
|
|
2
|
+
Schema,
|
|
3
|
+
fields,
|
|
4
|
+
validate,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserWatchlistResourceSchema(Schema):
|
|
9
|
+
not_blank = validate.Length(min=1, error="Field cannot be blank")
|
|
10
|
+
|
|
11
|
+
id = fields.Integer(dump_only=True)
|
|
12
|
+
user_id = fields.String(required=True, validate=not_blank)
|
|
13
|
+
resource_type = fields.String(required=True)
|
|
14
|
+
resource_id = fields.String(required=True)
|
|
15
|
+
is_active = fields.Boolean(required=True)
|
|
16
|
+
saved_search_id = fields.Integer(required=True)
|
|
17
|
+
updated_at = fields.DateTime(dump_only=True)
|
|
@@ -804,6 +804,9 @@ cs_models/resources/UserSearchHistoryItem/__init__.py,sha256=VAR16vegIC2J7P3s7Eo
|
|
|
804
804
|
cs_models/resources/UserSearchHistoryItem/models.py,sha256=GdNZsTEett2x_gU92iPbRFpozimmFWn_p9liUtXWRTk,532
|
|
805
805
|
cs_models/resources/UserSearchHistoryItem/schemas.py,sha256=e68GcY-1KV75VWwWCGryTufWXHL09h7b48UhxieoaUQ,747
|
|
806
806
|
cs_models/resources/UserSearchHistoryItem/test_user_search_history_item.py,sha256=eoiVJpVS-_Fe6k2Bc1oCTc6gRggI1N1kc_trTNQ1w60,2904
|
|
807
|
+
cs_models/resources/UserWatchlist/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
808
|
+
cs_models/resources/UserWatchlist/models.py,sha256=XPWn6KgwcWfAaYuaEkK1sRw304DvKbLXnvn_MjO_Q-Y,908
|
|
809
|
+
cs_models/resources/UserWatchlist/schemas.py,sha256=gM4N7ClcMGvyaSzIg95SSOw1EbFdZ2tUbAke33FwtS8,528
|
|
807
810
|
cs_models/resources/ViewConditionByTA/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
808
811
|
cs_models/resources/ViewConditionByTA/models.py,sha256=CieIW5mvmvok4dbglxd-ijMVI7gx-6C057CViSjuWoQ,764
|
|
809
812
|
cs_models/resources/ViewConditionByTA/schemas.py,sha256=Y0hoMeysHulflnPUchmDP0NDsSTKtIZH-UXRvp2fIRw,441
|
|
@@ -925,7 +928,7 @@ cs_models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
925
928
|
cs_models/utils/alchemy.py,sha256=fhINGFn41owJ2DLXQKXAAtLqeZ1BRzD_qU0wPK_bsGQ,1598
|
|
926
929
|
cs_models/utils/utils.py,sha256=bY623DuzycfPQiaOQT2AxfANeWfwr5w76dBuQ813-ns,3664
|
|
927
930
|
cs_models/utils/profiling/__init__.py,sha256=N-73vb0M92C975fxgXyBCBjCPELl8Oh21ZY_-tzDnns,569
|
|
928
|
-
cs_models-0.0.
|
|
929
|
-
cs_models-0.0.
|
|
930
|
-
cs_models-0.0.
|
|
931
|
-
cs_models-0.0.
|
|
931
|
+
cs_models-0.0.573.dist-info/METADATA,sha256=tqdBotJAitkQ5DeJorHCs6Dg41cQirSGgi-3XTQTKUk,791
|
|
932
|
+
cs_models-0.0.573.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
933
|
+
cs_models-0.0.573.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
|
|
934
|
+
cs_models-0.0.573.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|