cs-models 0.0.705__py3-none-any.whl → 0.0.707__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,49 @@
1
+ from sqlalchemy import (
2
+ Column,
3
+ Integer,
4
+ String,
5
+ DateTime,
6
+ ForeignKey,
7
+ Boolean,
8
+ )
9
+ from sqlalchemy.orm import relationship
10
+ from datetime import datetime
11
+
12
+ from ...database import Base
13
+
14
+
15
+ class UserDocumentHierarchyModel(Base):
16
+ __tablename__ = 'user_documents_hierarchy'
17
+
18
+ id = Column(Integer, primary_key=True)
19
+ provider_id = Column(String(128), nullable=False, index=True)
20
+ user_id = Column(String(128), nullable=False, index=True)
21
+ type = Column(String(50), nullable=False)
22
+ document_name = Column(String(255), nullable=True)
23
+ parent_id = Column(
24
+ Integer,
25
+ ForeignKey('user_documents_hierarchy.id'),
26
+ nullable=True
27
+ )
28
+ is_folder = Column(Boolean, nullable=True)
29
+ user_document_id = Column(
30
+ Integer,
31
+ ForeignKey('user_documents.id'),
32
+ nullable=True,
33
+ )
34
+ workbook_id = Column(
35
+ Integer,
36
+ ForeignKey('workbooks.id'),
37
+ nullable=True,
38
+ )
39
+ is_deleted = Column(Boolean, nullable=True)
40
+ is_trashed = Column(Boolean, nullable=True)
41
+ updated_at = Column(
42
+ DateTime,
43
+ nullable=False,
44
+ # https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
45
+ default=lambda: datetime.utcnow(),
46
+ onupdate=lambda: datetime.utcnow(),
47
+ )
48
+
49
+ children = relationship("UserDocumentHierarchyModel", backref='parent', remote_side=[id])
@@ -0,0 +1,22 @@
1
+ from marshmallow import (
2
+ Schema,
3
+ fields,
4
+ validate,
5
+ )
6
+
7
+
8
+ class UserDocumentHierarchyResourceSchema(Schema):
9
+ not_blank = validate.Length(min=1, error='Field cannot be blank')
10
+
11
+ id = fields.Integer(dump_only=True)
12
+ provider_id = fields.String(required=True)
13
+ user_id = fields.String(required=True)
14
+ type = fields.String(required=True)
15
+ document_name = fields.String(allow_none=True)
16
+ parent_id = fields.Integer(allow_none=True)
17
+ is_folder = fields.Boolean(allow_none=True)
18
+ user_document_id = fields.Integer(allow_none=True)
19
+ workbook_id = fields.Integer(allow_none=True)
20
+ is_deleted = fields.Boolean(allow_none=True)
21
+ is_trashed = fields.Boolean(allow_none=True)
22
+ updated_at = fields.DateTime(dump_only=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cs-models
3
- Version: 0.0.705
3
+ Version: 0.0.707
4
4
  Summary: MySQL db models
5
5
  Home-page: https://github.com/mindgram/cs-models
6
6
  Author: Shrey Verma
@@ -977,6 +977,9 @@ cs_models/resources/UserDocumentCompany/schemas.py,sha256=JwQQ4O8VvJziMai78xHNO9
977
977
  cs_models/resources/UserDocumentCondition/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
978
978
  cs_models/resources/UserDocumentCondition/models.py,sha256=FZzNgxc4-zZ5TiuJYfxNjPvi5mZCunTc9sVOXBGYpqc,1007
979
979
  cs_models/resources/UserDocumentCondition/schemas.py,sha256=BeeRrfrLW9N3k0IsOhoi3CXXos4rNbJ_ka4Qqbj-Ddw,550
980
+ cs_models/resources/UserDocumentHierarchy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
981
+ cs_models/resources/UserDocumentHierarchy/models.py,sha256=qz-vxxGo5hOrDBxJ8c9nLJmbObJbovnZprkuHzgMl-c,1425
982
+ cs_models/resources/UserDocumentHierarchy/schemas.py,sha256=2AqeGjErCd_mZxAPClphJa4jI4ELmLo0lfgPg-G6H8k,759
980
983
  cs_models/resources/UserDocumentIntervention/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
981
984
  cs_models/resources/UserDocumentIntervention/models.py,sha256=XDW1UIMnsQoyszHeel_aaCGnd_XfWxIOJF-JJBn9IoM,1019
982
985
  cs_models/resources/UserDocumentIntervention/schemas.py,sha256=XKgWDYGiU7NTPqNHkqxWgbdz0wMwt8__SlxrCPhEqrU,556
@@ -1168,7 +1171,7 @@ cs_models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1168
1171
  cs_models/utils/alchemy.py,sha256=fhINGFn41owJ2DLXQKXAAtLqeZ1BRzD_qU0wPK_bsGQ,1598
1169
1172
  cs_models/utils/utils.py,sha256=bY623DuzycfPQiaOQT2AxfANeWfwr5w76dBuQ813-ns,3664
1170
1173
  cs_models/utils/profiling/__init__.py,sha256=N-73vb0M92C975fxgXyBCBjCPELl8Oh21ZY_-tzDnns,569
1171
- cs_models-0.0.705.dist-info/METADATA,sha256=nhdu2HEy7x91TkN4ySb6Hs2kSHjqVHY4fFJHHDRanOc,792
1172
- cs_models-0.0.705.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
1173
- cs_models-0.0.705.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
1174
- cs_models-0.0.705.dist-info/RECORD,,
1174
+ cs_models-0.0.707.dist-info/METADATA,sha256=tsC9psgnm-6g4MZNZCAMaC493P8bz-skTsgQFsF8lfM,792
1175
+ cs_models-0.0.707.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
1176
+ cs_models-0.0.707.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
1177
+ cs_models-0.0.707.dist-info/RECORD,,