cs-models 0.0.689__py3-none-any.whl → 0.0.691__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.

File without changes
@@ -0,0 +1,27 @@
1
+ from datetime import datetime
2
+
3
+ from sqlalchemy import Column, DateTime, Boolean, ForeignKey, Integer, Text, String
4
+ from sqlalchemy.orm import relationship
5
+
6
+ from ...database import Base
7
+ from ..SmartGridCell.models import SmartGridCellModel
8
+
9
+
10
+ class SmartGridModel(Base):
11
+ __tablename__ = "smart_grids"
12
+
13
+ id = Column(Integer, primary_key=True)
14
+ is_deleted = Column(Boolean, nullable=True)
15
+ updated_at = Column(
16
+ DateTime,
17
+ nullable=False,
18
+ # https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
19
+ default=lambda: datetime.utcnow(),
20
+ onupdate=lambda: datetime.utcnow(),
21
+ )
22
+
23
+ cells = relationship(
24
+ "SmartGridCellModel",
25
+ order_by=SmartGridCellModel.row,
26
+ back_populates="smart_grid",
27
+ )
@@ -0,0 +1,13 @@
1
+ from marshmallow import Schema, fields
2
+ from ..SmartGridCell.schemas import SmartGridCellResourceSchema
3
+
4
+
5
+ class SmartGridResourceSchema(Schema):
6
+ id = fields.Integer(dump_only=True)
7
+ is_deleted = fields.Boolean(allow_none=True)
8
+ cells = fields.Nested(
9
+ SmartGridCellResourceSchema(exclude=("smart_grid_id",)),
10
+ many=True,
11
+ dump_only=True,
12
+ )
13
+ updated_at = fields.DateTime(dump_only=True)
@@ -10,6 +10,11 @@ class SmartGridCellModel(Base):
10
10
  __tablename__ = "smart_grid_cells"
11
11
 
12
12
  id = Column(Integer, primary_key=True)
13
+ smart_grid_id = Column(
14
+ Integer,
15
+ ForeignKey("smart_grids.id"),
16
+ nullable=False,
17
+ )
13
18
  row = Column(Integer, nullable=False)
14
19
  col = Column(Integer, nullable=False)
15
20
  type = Column(String(20), nullable=False)
@@ -31,3 +36,8 @@ class SmartGridCellModel(Base):
31
36
  user_query = relationship(
32
37
  "AssistantUserQueryModel",
33
38
  )
39
+
40
+ smart_grid = relationship(
41
+ "SmartGridModel",
42
+ back_populates="cells",
43
+ )
@@ -7,6 +7,7 @@ class SmartGridCellResourceSchema(Schema):
7
7
  """Class for AssistantCommandResource schema"""
8
8
 
9
9
  id = fields.Integer(dump_only=True)
10
+ smart_grid_id = fields.Integer(required=True)
10
11
  row = fields.Integer(required=True)
11
12
  col = fields.Integer(required=True)
12
13
  type = fields.String(required=True)
@@ -5,7 +5,7 @@ from marshmallow import (
5
5
  )
6
6
 
7
7
 
8
- class WatchlistDigestResourceSchema(Schema):
8
+ class UserSavedSearchDigestResourceSchema(Schema):
9
9
  not_blank = validate.Length(min=1, error="Field cannot be blank")
10
10
 
11
11
  id = fields.Integer(dump_only=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cs-models
3
- Version: 0.0.689
3
+ Version: 0.0.691
4
4
  Summary: MySQL db models
5
5
  Home-page: https://github.com/mindgram/cs-models
6
6
  Author: Shrey Verma
@@ -869,9 +869,12 @@ cs_models/resources/ScratchpadTable/schemas.py,sha256=pQPf6xpsg0ZKDM9xwesvrpdq8H
869
869
  cs_models/resources/SearchLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
870
870
  cs_models/resources/SearchLink/models.py,sha256=l1tPCSKHK7Wq1OUWFH72NYncEt6Q3bR0P6ii7YKoxCM,729
871
871
  cs_models/resources/SearchLink/schemas.py,sha256=A8Y6LRgw7MHs9bihf0gZPfqp6KDm0Z8k6PJSL9WVxsc,448
872
+ cs_models/resources/SmartGrid/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
873
+ cs_models/resources/SmartGrid/models.py,sha256=Ir7ZzVLoKdbUOy8XV84T1c2GVLNcDWNKXg-yaX9uYms,808
874
+ cs_models/resources/SmartGrid/schemas.py,sha256=tX10bmOXBump0AN4LOU-jhKRbNYiCzHsCSzHjBwsPJ8,423
872
875
  cs_models/resources/SmartGridCell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
873
- cs_models/resources/SmartGridCell/models.py,sha256=qolCmQ7C2BUetYADV3Ju6V5EK-byFK3RWAwU1mtYOqk,987
874
- cs_models/resources/SmartGridCell/schemas.py,sha256=JVPfua3I14z8h79G5kRMjZYqsyyuyHM2rELSH3cc-Zc,716
876
+ cs_models/resources/SmartGridCell/models.py,sha256=vPXX8YaVPMjq6IgGhgAy46EnmbFgGCaHlZfNEUd9hq4,1196
877
+ cs_models/resources/SmartGridCell/schemas.py,sha256=l6kljC4vUd1IoTwezM8UEQWnPoaJru8MqqPKlfyPdNw,766
875
878
  cs_models/resources/Stream/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
876
879
  cs_models/resources/Stream/models.py,sha256=wXb7yOjW82ZqmLhRcDhjLPk6_WJ5FGmvKpOcSvDMuBM,1884
877
880
  cs_models/resources/Stream/schemas.py,sha256=ZFsdEKINFGaSBUAcQQvilq5MKpYGliZseguQoc_opxk,3111
@@ -994,7 +997,7 @@ cs_models/resources/UserSavedSearchAccess/models.py,sha256=mMbMvvMnKMTTfjGR0_z4o
994
997
  cs_models/resources/UserSavedSearchAccess/schemas.py,sha256=p7zykn8OsYpGHhfsy5aTxYFX1IYojaFcOC7HPURhxwg,605
995
998
  cs_models/resources/UserSavedSearchDigest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
996
999
  cs_models/resources/UserSavedSearchDigest/models.py,sha256=alX7owQynkde0zZO2nk3Qz8M_gmDWgbfRj4pTIZGWzA,940
997
- cs_models/resources/UserSavedSearchDigest/schemas.py,sha256=IN4Le_mtuL1lRF99FD9UgGlz8fq6qzp_9scUbSUF9Ag,497
1000
+ cs_models/resources/UserSavedSearchDigest/schemas.py,sha256=hhwrqEdqeSGSrASid5-n6Ll4yy2satrh37Q48wdxTZ0,503
998
1001
  cs_models/resources/UserSearchHistoryItem/__init__.py,sha256=VAR16vegIC2J7P3s7EoILHGN1WtkSwABRkxajmlmPoc,2864
999
1002
  cs_models/resources/UserSearchHistoryItem/models.py,sha256=GdNZsTEett2x_gU92iPbRFpozimmFWn_p9liUtXWRTk,532
1000
1003
  cs_models/resources/UserSearchHistoryItem/schemas.py,sha256=e68GcY-1KV75VWwWCGryTufWXHL09h7b48UhxieoaUQ,747
@@ -1144,7 +1147,7 @@ cs_models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1144
1147
  cs_models/utils/alchemy.py,sha256=fhINGFn41owJ2DLXQKXAAtLqeZ1BRzD_qU0wPK_bsGQ,1598
1145
1148
  cs_models/utils/utils.py,sha256=bY623DuzycfPQiaOQT2AxfANeWfwr5w76dBuQ813-ns,3664
1146
1149
  cs_models/utils/profiling/__init__.py,sha256=N-73vb0M92C975fxgXyBCBjCPELl8Oh21ZY_-tzDnns,569
1147
- cs_models-0.0.689.dist-info/METADATA,sha256=NrNLTy2FOoM9-ZEdLOEnXSMW78hK92gFfm0wuWkSshg,792
1148
- cs_models-0.0.689.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
1149
- cs_models-0.0.689.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
1150
- cs_models-0.0.689.dist-info/RECORD,,
1150
+ cs_models-0.0.691.dist-info/METADATA,sha256=nzIXX8FuqKSjRUsk4EyU0oI8rx49YUwb1JXzVnPQokY,792
1151
+ cs_models-0.0.691.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
1152
+ cs_models-0.0.691.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
1153
+ cs_models-0.0.691.dist-info/RECORD,,