f3-data-models 0.4.0__tar.gz → 0.4.2__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.
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/PKG-INFO +1 -1
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/f3_data_models/models.py +37 -2
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/pyproject.toml +1 -1
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/README.md +0 -0
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/f3_data_models/__init__.py +0 -0
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/f3_data_models/testing.py +0 -0
- {f3_data_models-0.4.0 → f3_data_models-0.4.2}/f3_data_models/utils.py +0 -0
@@ -11,6 +11,7 @@ from sqlalchemy import (
|
|
11
11
|
DateTime,
|
12
12
|
Float,
|
13
13
|
ForeignKey,
|
14
|
+
Index,
|
14
15
|
Integer,
|
15
16
|
func,
|
16
17
|
UniqueConstraint,
|
@@ -100,6 +101,13 @@ class Event_Category(enum.Enum):
|
|
100
101
|
third_f = 3
|
101
102
|
|
102
103
|
|
104
|
+
class Request_Type(enum.Enum):
|
105
|
+
create_location = 1
|
106
|
+
create_event = 2
|
107
|
+
edit = 3
|
108
|
+
delete_event = 4
|
109
|
+
|
110
|
+
|
103
111
|
class Base(DeclarativeBase):
|
104
112
|
"""
|
105
113
|
Base class for all models, providing common methods.
|
@@ -349,6 +357,12 @@ class Org(Base):
|
|
349
357
|
created: Mapped[dt_create]
|
350
358
|
updated: Mapped[dt_update]
|
351
359
|
|
360
|
+
__table_args__ = (
|
361
|
+
Index("idx_orgs_parent_id", "parent_id"),
|
362
|
+
Index("idx_orgs_org_type", "org_type"),
|
363
|
+
Index("idx_orgs_is_active", "is_active"),
|
364
|
+
)
|
365
|
+
|
352
366
|
locations: Mapped[Optional[List["Location"]]] = relationship(
|
353
367
|
"Location", cascade="expunge"
|
354
368
|
)
|
@@ -421,6 +435,10 @@ class EventType_x_Event(Base):
|
|
421
435
|
event_type_id: Mapped[int] = mapped_column(
|
422
436
|
ForeignKey("event_types.id"), primary_key=True
|
423
437
|
)
|
438
|
+
__table_args__ = (
|
439
|
+
Index("idx_events_x_event_types_event_id", "event_id"),
|
440
|
+
Index("idx_events_x_event_types_event_type_id", "event_type_id"),
|
441
|
+
)
|
424
442
|
|
425
443
|
event: Mapped["Event"] = relationship(back_populates="event_x_event_types")
|
426
444
|
|
@@ -573,6 +591,12 @@ class Location(Base):
|
|
573
591
|
created: Mapped[dt_create]
|
574
592
|
updated: Mapped[dt_update]
|
575
593
|
|
594
|
+
__table_args__ = (
|
595
|
+
Index("idx_locations_org_id", "org_id"),
|
596
|
+
Index("idx_locations_name", "name"),
|
597
|
+
Index("idx_locations_is_active", "is_active"),
|
598
|
+
)
|
599
|
+
|
576
600
|
|
577
601
|
class Event(Base):
|
578
602
|
"""
|
@@ -649,6 +673,12 @@ class Event(Base):
|
|
649
673
|
created: Mapped[dt_create]
|
650
674
|
updated: Mapped[dt_update]
|
651
675
|
|
676
|
+
__table_args__ = (
|
677
|
+
Index("idx_events_org_id", "org_id"),
|
678
|
+
Index("idx_events_location_id", "location_id"),
|
679
|
+
Index("idx_events_is_active", "is_active"),
|
680
|
+
)
|
681
|
+
|
652
682
|
org: Mapped[Org] = relationship(innerjoin=True, cascade="expunge", viewonly=True)
|
653
683
|
location: Mapped[Location] = relationship(
|
654
684
|
innerjoin=True, cascade="expunge", viewonly=True
|
@@ -1113,6 +1143,7 @@ class UpdateRequest(Base):
|
|
1113
1143
|
location_lng (Optional[float]): The longitude of the location.
|
1114
1144
|
location_id (Optional[int]): The ID of the location.
|
1115
1145
|
location_contact_email (Optional[str]): The contact email of the location.
|
1146
|
+
ao_name (Optional[text]): The name of the AO.
|
1116
1147
|
ao_logo (Optional[text]): The URL of the AO logo.
|
1117
1148
|
submitted_by (str): The user who submitted the request.
|
1118
1149
|
submitter_validated (Optional[bool]): Whether the submitter has validated the request. Default is False.
|
@@ -1120,13 +1151,16 @@ class UpdateRequest(Base):
|
|
1120
1151
|
reviewed_at (Optional[datetime]): The timestamp when the request was reviewed.
|
1121
1152
|
status (Update_Request_Status): The status of the request. Default is 'pending'.
|
1122
1153
|
meta (Optional[Dict[str, Any]]): Additional metadata for the request.
|
1154
|
+
request_type (Request_Type): The type of the request.
|
1123
1155
|
created (datetime): The timestamp when the record was created.
|
1124
1156
|
updated (datetime): The timestamp when the record was last updated.
|
1125
1157
|
"""
|
1126
1158
|
|
1127
1159
|
__tablename__ = "update_requests"
|
1128
1160
|
|
1129
|
-
id: Mapped[Uuid] = mapped_column(
|
1161
|
+
id: Mapped[Uuid] = mapped_column(
|
1162
|
+
UUID(as_uuid=True), primary_key=True, server_default=func.gen_random_uuid()
|
1163
|
+
)
|
1130
1164
|
token: Mapped[Uuid] = mapped_column(
|
1131
1165
|
UUID(as_uuid=True), server_default=func.gen_random_uuid()
|
1132
1166
|
)
|
@@ -1168,6 +1202,7 @@ class UpdateRequest(Base):
|
|
1168
1202
|
location_id: Mapped[Optional[int]] = mapped_column(ForeignKey("locations.id"))
|
1169
1203
|
location_contact_email: Mapped[Optional[str]]
|
1170
1204
|
|
1205
|
+
ao_name: Mapped[Optional[text]]
|
1171
1206
|
ao_logo: Mapped[Optional[text]]
|
1172
1207
|
|
1173
1208
|
submitted_by: Mapped[text]
|
@@ -1178,6 +1213,6 @@ class UpdateRequest(Base):
|
|
1178
1213
|
Enum(Update_Request_Status), default=Update_Request_Status.pending
|
1179
1214
|
)
|
1180
1215
|
meta: Mapped[Optional[Dict[str, Any]]]
|
1181
|
-
|
1216
|
+
request_type: Mapped[Request_Type]
|
1182
1217
|
created: Mapped[dt_create]
|
1183
1218
|
updated: Mapped[dt_update]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|