f3-data-models 0.1.2__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: f3-data-models
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: The data schema and models for F3 Nation applications.
5
5
  Home-page: https://github.com/F3-Nation/f3-data-models
6
6
  License: MIT
@@ -22,6 +22,7 @@ Requires-Dist: sphinx-multiversion (>=0.2.4,<0.3.0)
22
22
  Requires-Dist: sphinx-rtd-theme (>=3.0.2,<4.0.0)
23
23
  Requires-Dist: sqlalchemy (>=2.0.36,<3.0.0)
24
24
  Requires-Dist: sqlalchemy-schemadisplay (>=2.0,<3.0)
25
+ Requires-Dist: sqlmodel (>=0.0.22,<0.0.23)
25
26
  Project-URL: Documentation, https://github.io/F3-Nation/f3-data-models
26
27
  Project-URL: Repository, https://github.com/F3-Nation/f3-data-models
27
28
  Description-Content-Type: text/markdown
@@ -118,6 +118,7 @@ class SlackSpace(Base):
118
118
  settings (Optional[Dict[str, Any]]): Slack Bot settings for the Slack workspace.
119
119
 
120
120
  org_x_slack (Org_x_Slack): The organization associated with this Slack workspace.
121
+ org (Org): The organization associated with this Slack workspace.
121
122
  """
122
123
 
123
124
  __tablename__ = "slack_spaces"
@@ -128,6 +129,9 @@ class SlackSpace(Base):
128
129
  settings: Mapped[Optional[Dict[str, Any]]]
129
130
 
130
131
  org_x_slack: Mapped["Org_x_Slack"] = relationship(back_populates="slack_space")
132
+ org: Mapped["Org"] = relationship(
133
+ back_populates="slack_space", secondary="org_x_slack", lazy="joined"
134
+ )
131
135
 
132
136
 
133
137
  class OrgType(Base):
@@ -214,9 +218,11 @@ class Role_x_Permission(Base):
214
218
  role_id: Mapped[int] = mapped_column(ForeignKey("roles.id"))
215
219
  permission_id: Mapped[int] = mapped_column(ForeignKey("permissions.id"))
216
220
 
217
- role: Mapped["Role"] = relationship(back_populates="role_x_permission")
221
+ role: Mapped["Role"] = relationship(
222
+ back_populates="role_x_permission", lazy="joined"
223
+ )
218
224
  permissions: Mapped[List["Permission"]] = relationship(
219
- back_populates="role_x_permission"
225
+ back_populates="role_x_permission", lazy="joined"
220
226
  )
221
227
 
222
228
 
@@ -242,9 +248,13 @@ class Role_x_User_x_Org(Base):
242
248
  user_id: Mapped[int] = mapped_column(ForeignKey("users.id"))
243
249
  org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"))
244
250
 
245
- role: Mapped["Role"] = relationship(back_populates="role_x_user_x_org")
246
- user: Mapped["User"] = relationship(back_populates="role_x_user_x_org")
247
- org: Mapped["Org"] = relationship(back_populates="role_x_user_x_org")
251
+ role: Mapped["Role"] = relationship(
252
+ back_populates="role_x_user_x_org", lazy="joined"
253
+ )
254
+ user: Mapped["User"] = relationship(
255
+ back_populates="role_x_user_x_org", lazy="joined"
256
+ )
257
+ org: Mapped["Org"] = relationship(back_populates="role_x_user_x_org", lazy="joined")
248
258
 
249
259
 
250
260
  class Org(Base):
@@ -269,6 +279,9 @@ class Org(Base):
269
279
  parent_org (Optional[Org]): The parent organization.
270
280
  child_orgs (List[Org]): The child organizations.
271
281
  locations (List[Location]): The locations associated with the organization.
282
+ event_tags (List[EventTag]): The event tags associated with the organization.
283
+ event_types (List[EventType]): The event types associated with the organization.
284
+ events (List[Event]): The events associated with the organization.
272
285
  """
273
286
 
274
287
  __tablename__ = "orgs"
@@ -294,7 +307,16 @@ class Org(Base):
294
307
  child_orgs: Mapped[List["Org"]] = relationship(
295
308
  "Org", back_populates="parent_org", join_depth=3
296
309
  )
297
- locations: Mapped[List["Location"]] = relationship(back_populates="org")
310
+ locations: Mapped[List["Location"]] = relationship(
311
+ back_populates="org", lazy="joined"
312
+ )
313
+ event_tags: Mapped[List["EventTag"]] = relationship(
314
+ back_populates="org", secondary="event_tags_x_org", lazy="joined"
315
+ )
316
+ event_types: Mapped[List["EventType"]] = relationship(
317
+ back_populates="org", secondary="event_types_x_org", lazy="joined"
318
+ )
319
+ events: Mapped[List["Event"]] = relationship(back_populates="org", lazy="joined")
298
320
 
299
321
 
300
322
  class EventType(Base):
@@ -316,7 +338,9 @@ class EventType(Base):
316
338
  acronyms: Mapped[Optional[str]]
317
339
  category_id: Mapped[int] = mapped_column(ForeignKey("event_categories.id"))
318
340
 
319
- event_category: Mapped["EventCategory"] = relationship(back_populates="event_types")
341
+ event_category: Mapped["EventCategory"] = relationship(
342
+ back_populates="event_types", lazy="joined"
343
+ )
320
344
 
321
345
 
322
346
  class EventType_x_Event(Base):
@@ -338,9 +362,11 @@ class EventType_x_Event(Base):
338
362
  event_id: Mapped[int] = mapped_column(ForeignKey("events.id"))
339
363
  event_type_id: Mapped[int] = mapped_column(ForeignKey("event_types.id"))
340
364
 
341
- event: Mapped["Event"] = relationship(back_populates="events_x_event_types")
365
+ event: Mapped["Event"] = relationship(
366
+ back_populates="events_x_event_types", lazy="joined"
367
+ )
342
368
  event_type: Mapped["EventType"] = relationship(
343
- back_populates="events_x_event_types"
369
+ back_populates="events_x_event_types", lazy="joined"
344
370
  )
345
371
 
346
372
 
@@ -365,8 +391,10 @@ class EventType_x_Org(Base):
365
391
  org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"))
366
392
  is_default: Mapped[bool]
367
393
 
368
- event_type: Mapped["EventType"] = relationship(back_populates="event_type_x_org")
369
- org: Mapped["Org"] = relationship(back_populates="event_type_x_org")
394
+ event_type: Mapped["EventType"] = relationship(
395
+ back_populates="event_type_x_org", lazy="joined"
396
+ )
397
+ org: Mapped["Org"] = relationship(back_populates="event_type_x_org", lazy="joined")
370
398
 
371
399
 
372
400
  class EventTag(Base):
@@ -405,8 +433,12 @@ class EventTag_x_Event(Base):
405
433
  event_id: Mapped[int] = mapped_column(ForeignKey("events.id"))
406
434
  event_tag_id: Mapped[int] = mapped_column(ForeignKey("event_tags.id"))
407
435
 
408
- event: Mapped["Event"] = relationship(back_populates="event_tag_x_event")
409
- event_tags: Mapped["EventTag"] = relationship(back_populates="event_tag_x_event")
436
+ event: Mapped["Event"] = relationship(
437
+ back_populates="event_tag_x_event", lazy="joined"
438
+ )
439
+ event_tag: Mapped["EventTag"] = relationship(
440
+ back_populates="event_tag_x_event", lazy="joined"
441
+ )
410
442
 
411
443
 
412
444
  class EventTag_x_Org(Base):
@@ -430,8 +462,10 @@ class EventTag_x_Org(Base):
430
462
  org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"))
431
463
  color_override: Mapped[Optional[str]]
432
464
 
433
- event_tag: Mapped["EventTag"] = relationship(back_populates="event_tag_x_org")
434
- org: Mapped["Org"] = relationship(back_populates="event_tag_x_org")
465
+ event_tag: Mapped["EventTag"] = relationship(
466
+ back_populates="event_tag_x_org", lazy="joined"
467
+ )
468
+ org: Mapped["Org"] = relationship(back_populates="event_tag_x_org", lazy="joined")
435
469
 
436
470
 
437
471
  class Org_x_Slack(Base):
@@ -453,8 +487,10 @@ class Org_x_Slack(Base):
453
487
  org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"))
454
488
  slack_space_id: Mapped[str] = mapped_column(ForeignKey("slack_spaces.id"))
455
489
 
456
- slack_space: Mapped["SlackSpace"] = relationship(back_populates="org_x_slack")
457
- org: Mapped["Org"] = relationship(back_populates="org_x_slack")
490
+ slack_space: Mapped["SlackSpace"] = relationship(
491
+ back_populates="org_x_slack", lazy="joined"
492
+ )
493
+ org: Mapped["Org"] = relationship(back_populates="org_x_slack", lazy="joined")
458
494
 
459
495
 
460
496
  class Location(Base):
@@ -492,7 +528,7 @@ class Location(Base):
492
528
  address_country: Mapped[Optional[str]]
493
529
  meta: Mapped[Optional[Dict[str, Any]]]
494
530
 
495
- org: Mapped["Org"] = relationship(back_populates="locations")
531
+ org: Mapped["Org"] = relationship(back_populates="locations", lazy="joined")
496
532
 
497
533
 
498
534
  class Event(Base):
@@ -533,6 +569,8 @@ class Event(Base):
533
569
  attendance (List[Attendance]): The attendance records for this event.
534
570
  event_tags_x_event (List[EventTag_x_Event]): The event tags associated with this event.
535
571
  event_types_x_event (List[EventType_x_Event]): The event types associated with this event.
572
+ event_tags (List[EventTag]): The event tags associated with this event.
573
+ event_types (List[EventType]): The event types associated with this event.
536
574
  """
537
575
 
538
576
  __tablename__ = "events"
@@ -563,19 +601,29 @@ class Event(Base):
563
601
  backblast_ts: Mapped[Optional[float]]
564
602
  meta: Mapped[Optional[Dict[str, Any]]]
565
603
 
566
- org: Mapped["Org"] = relationship(back_populates="events")
567
- location: Mapped["Location"] = relationship(back_populates="events")
604
+ org: Mapped["Org"] = relationship(back_populates="events", lazy="joined")
605
+ location: Mapped["Location"] = relationship(back_populates="events", lazy="joined")
568
606
  series: Mapped["Event"] = relationship(
569
- back_populates="events", remote_side="Event.id"
607
+ back_populates="events", remote_side="Event.id", lazy="joined"
608
+ )
609
+ occurences: Mapped[List["Event"]] = relationship(
610
+ back_populates="series", lazy="joined"
611
+ )
612
+ attendance: Mapped[List["Attendance"]] = relationship(
613
+ back_populates="events", lazy="joined"
570
614
  )
571
- occurences: Mapped[List["Event"]] = relationship(back_populates="series")
572
- attendance: Mapped[List["Attendance"]] = relationship(back_populates="events")
573
615
  event_tags_x_event: Mapped[List["EventTag_x_Event"]] = relationship(
574
616
  back_populates="events"
575
617
  )
576
618
  event_types_x_event: Mapped[List["EventType_x_Event"]] = relationship(
577
619
  back_populates="events"
578
620
  )
621
+ event_tags: Mapped[List["EventTag"]] = relationship(
622
+ back_populates="event", secondary="event_tags_x_event", lazy="joined"
623
+ )
624
+ event_types: Mapped[List["EventType"]] = relationship(
625
+ back_populates="event", secondary="event_types_x_event", lazy="joined"
626
+ )
579
627
 
580
628
 
581
629
  class AttendanceType(Base):
@@ -621,10 +669,10 @@ class Attendance(Base):
621
669
  is_planned: Mapped[bool]
622
670
  meta: Mapped[Optional[Dict[str, Any]]]
623
671
 
624
- event: Mapped["Event"] = relationship(back_populates="attendance")
625
- user: Mapped["User"] = relationship(back_populates="attendance")
672
+ event: Mapped["Event"] = relationship(back_populates="attendance", lazy="joined")
673
+ user: Mapped["User"] = relationship(back_populates="attendance", lazy="joined")
626
674
  attendance_type: Mapped["AttendanceType"] = relationship(
627
- back_populates="attendance"
675
+ back_populates="attendance", lazy="joined"
628
676
  )
629
677
 
630
678
 
@@ -647,6 +695,8 @@ class User(Base):
647
695
  achievements_x_user (List[Achievement_x_User]): The achievements associated with this user.
648
696
  positions_x_orgs_x_users (List[Position_x_Org_x_User]): The positions associated with this user.
649
697
  roles_x_users_x_org (List[Role_x_User_x_Org]): The roles associated with this user.
698
+ positions (List[Position]): The positions associated with this user.
699
+ roles (List[Role]): The roles associated with this user.
650
700
  """
651
701
 
652
702
  __tablename__ = "users"
@@ -660,9 +710,13 @@ class User(Base):
660
710
  avatar_url: Mapped[Optional[str]]
661
711
  meta: Mapped[Optional[Dict[str, Any]]]
662
712
 
663
- home_region: Mapped["Org"] = relationship(back_populates="users")
664
- attendance: Mapped[List["Attendance"]] = relationship(back_populates="users")
665
- slack_users: Mapped[List["SlackUser"]] = relationship(back_populates="users")
713
+ home_region: Mapped["Org"] = relationship(back_populates="users", lazy="joined")
714
+ attendance: Mapped[List["Attendance"]] = relationship(
715
+ back_populates="users", lazy="joined"
716
+ )
717
+ slack_users: Mapped[List["SlackUser"]] = relationship(
718
+ back_populates="users", lazy="joined"
719
+ )
666
720
  achievements_x_user: Mapped[List["Achievement_x_User"]] = relationship(
667
721
  back_populates="user"
668
722
  )
@@ -672,6 +726,15 @@ class User(Base):
672
726
  roles_x_users_x_org: Mapped[List["Role_x_User_x_Org"]] = relationship(
673
727
  back_populates="user"
674
728
  )
729
+ achievements: Mapped[List["Achievement"]] = relationship(
730
+ back_populates="user", secondary="achievements_x_users", lazy="joined"
731
+ )
732
+ positions: Mapped[List["Position"]] = relationship(
733
+ back_populates="user", secondary="positions_x_orgs_x_users", lazy="joined"
734
+ )
735
+ roles: Mapped[List["Role"]] = relationship(
736
+ back_populates="user", secondary="roles_x_users_x_org", lazy="joined"
737
+ )
675
738
 
676
739
 
677
740
  class SlackUser(Base):
@@ -716,8 +779,10 @@ class SlackUser(Base):
716
779
  meta: Mapped[Optional[Dict[str, Any]]]
717
780
  slack_updated: Mapped[Optional[datetime]]
718
781
 
719
- slack_space: Mapped["SlackSpace"] = relationship(back_populates="slack_users")
720
- user: Mapped["User"] = relationship(back_populates="slack_users")
782
+ slack_space: Mapped["SlackSpace"] = relationship(
783
+ back_populates="slack_users", lazy="joined"
784
+ )
785
+ user: Mapped["User"] = relationship(back_populates="slack_users", lazy="joined")
721
786
 
722
787
 
723
788
  class Achievement(Base):
@@ -761,9 +826,11 @@ class Achievement_x_User(Base):
761
826
  date_awarded: Mapped[date]
762
827
 
763
828
  achievement: Mapped["Achievement"] = relationship(
764
- back_populates="achievement_x_user"
829
+ back_populates="achievement_x_user", lazy="joined"
830
+ )
831
+ user: Mapped["User"] = relationship(
832
+ back_populates="achievement_x_user", lazy="joined"
765
833
  )
766
- user: Mapped["User"] = relationship(back_populates="achievement_x_user")
767
834
 
768
835
 
769
836
  class Achievement_x_Org(Base):
@@ -786,9 +853,9 @@ class Achievement_x_Org(Base):
786
853
  org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"))
787
854
 
788
855
  achievement: Mapped["Achievement"] = relationship(
789
- back_populates="achievement_x_org"
856
+ back_populates="achievement_x_org", lazy="joined"
790
857
  )
791
- org: Mapped["Org"] = relationship(back_populates="achievement_x_org")
858
+ org: Mapped["Org"] = relationship(back_populates="achievement_x_org", lazy="joined")
792
859
 
793
860
 
794
861
  class Position(Base):
@@ -834,9 +901,15 @@ class Position_x_Org_x_User(Base):
834
901
  org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"))
835
902
  user_id: Mapped[int] = mapped_column(ForeignKey("users.id"))
836
903
 
837
- position: Mapped["Position"] = relationship(back_populates="position_x_org_x_user")
838
- org: Mapped["Org"] = relationship(back_populates="position_x_org_x_user")
839
- user: Mapped["User"] = relationship(back_populates="position_x_org_x_user")
904
+ position: Mapped["Position"] = relationship(
905
+ back_populates="position_x_org_x_user", lazy="joined"
906
+ )
907
+ org: Mapped["Org"] = relationship(
908
+ back_populates="position_x_org_x_user", lazy="joined"
909
+ )
910
+ user: Mapped["User"] = relationship(
911
+ back_populates="position_x_org_x_user", lazy="joined"
912
+ )
840
913
 
841
914
 
842
915
  class Expansion(Base):
@@ -885,5 +958,9 @@ class Expansion_x_User(Base):
885
958
  date: Mapped[date]
886
959
  notes: Mapped[Optional[text]]
887
960
 
888
- expansion: Mapped["Expansion"] = relationship(back_populates="expansion_x_user")
889
- user: Mapped["User"] = relationship(back_populates="expansion_x_user")
961
+ expansion: Mapped["Expansion"] = relationship(
962
+ back_populates="expansion_x_user", lazy="joined"
963
+ )
964
+ user: Mapped["User"] = relationship(
965
+ back_populates="expansion_x_user", lazy="joined"
966
+ )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "f3-data-models"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  description = "The data schema and models for F3 Nation applications."
5
5
  authors = ["Evan Petzoldt <evan.petzoldt@protonmail.com>"]
6
6
  readme = "README.md"
@@ -23,6 +23,7 @@ sphinx-autodoc-typehints = "^2.5.0"
23
23
  sphinx-rtd-theme = "^3.0.2"
24
24
  sphinx-multiversion = "^0.2.4"
25
25
  psycopg2-binary = "^2.9.10"
26
+ sqlmodel = "^0.0.22"
26
27
 
27
28
 
28
29
  [build-system]
File without changes