f3-data-models 0.1.5__tar.gz → 0.1.6__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.1.5 → f3_data_models-0.1.6}/PKG-INFO +1 -1
- {f3_data_models-0.1.5 → f3_data_models-0.1.6}/f3_data_models/models.py +26 -66
- {f3_data_models-0.1.5 → f3_data_models-0.1.6}/pyproject.toml +1 -1
- {f3_data_models-0.1.5 → f3_data_models-0.1.6}/README.md +0 -0
- {f3_data_models-0.1.5 → f3_data_models-0.1.6}/f3_data_models/__init__.py +0 -0
- {f3_data_models-0.1.5 → f3_data_models-0.1.6}/f3_data_models/utils.py +0 -0
@@ -10,6 +10,7 @@ from sqlalchemy import (
|
|
10
10
|
ForeignKey,
|
11
11
|
Integer,
|
12
12
|
func,
|
13
|
+
UniqueConstraint,
|
13
14
|
)
|
14
15
|
from typing_extensions import Annotated
|
15
16
|
from sqlalchemy.orm import (
|
@@ -568,9 +569,9 @@ class Attendance(Base):
|
|
568
569
|
Model representing an attendance record.
|
569
570
|
|
570
571
|
Attributes:
|
572
|
+
id (int): Primary Key of the model.
|
571
573
|
event_id (int): The ID of the associated event.
|
572
574
|
user_id (Optional[int]): The ID of the associated user.
|
573
|
-
attendance_type_id (int): The ID of the associated attendance type.
|
574
575
|
is_planned (bool): Whether this is planned attendance (True) vs actual attendance (False).
|
575
576
|
meta (Optional[Dict[str, Any]]): Additional metadata for the attendance.
|
576
577
|
created (datetime): The timestamp when the record was created.
|
@@ -578,16 +579,34 @@ class Attendance(Base):
|
|
578
579
|
"""
|
579
580
|
|
580
581
|
__tablename__ = "attendance"
|
582
|
+
__table_args__ = (UniqueConstraint("event_id", "user_id", "is_planned"),)
|
581
583
|
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
584
|
+
id: Mapped[intpk]
|
585
|
+
event_id: Mapped[int] = mapped_column(ForeignKey("events.id"))
|
586
|
+
user_id: Mapped[int] = mapped_column(ForeignKey("users.id"))
|
587
|
+
is_planned: Mapped[bool]
|
588
|
+
meta: Mapped[Optional[Dict[str, Any]]]
|
589
|
+
created: Mapped[dt_create]
|
590
|
+
updated: Mapped[dt_update]
|
591
|
+
|
592
|
+
|
593
|
+
class Attendance_x_AttenanceType(Base):
|
594
|
+
"""
|
595
|
+
Model representing the association between attendance and attendance types.
|
596
|
+
|
597
|
+
Attributes:
|
598
|
+
attendance_id (int): The ID of the associated attendance.
|
599
|
+
attendance_type_id (int): The ID of the associated attendance type.
|
600
|
+
"""
|
601
|
+
|
602
|
+
__tablename__ = "attendance_x_attendance_types"
|
603
|
+
|
604
|
+
attendance_id: Mapped[int] = mapped_column(
|
605
|
+
ForeignKey("attendance.id"), primary_key=True
|
606
|
+
)
|
586
607
|
attendance_type_id: Mapped[int] = mapped_column(
|
587
608
|
ForeignKey("attendance_types.id"), primary_key=True
|
588
609
|
)
|
589
|
-
is_planned: Mapped[bool] = mapped_column(Boolean, primary_key=True)
|
590
|
-
meta: Mapped[Optional[Dict[str, Any]]]
|
591
610
|
|
592
611
|
|
593
612
|
class User(Base):
|
@@ -826,65 +845,6 @@ class Expansion_x_User(Base):
|
|
826
845
|
notes: Mapped[Optional[text]]
|
827
846
|
|
828
847
|
|
829
|
-
# def upgrade() -> None:
|
830
|
-
# # ### commands auto generated by Alembic - please adjust! ###
|
831
|
-
# op.create_table(
|
832
|
-
# "magiclinkauthrecord",
|
833
|
-
# sa.Column("id", sa.Integer(), nullable=False),
|
834
|
-
# sa.Column("email", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
835
|
-
# sa.Column("otp_hash", sa.LargeBinary(), nullable=False),
|
836
|
-
# sa.Column(
|
837
|
-
# "created",
|
838
|
-
# sa.DateTime(timezone=True),
|
839
|
-
# server_default=sa.text("(CURRENT_TIMESTAMP)"),
|
840
|
-
# nullable=False,
|
841
|
-
# ),
|
842
|
-
# sa.Column(
|
843
|
-
# "expiration",
|
844
|
-
# sa.DateTime(timezone=True),
|
845
|
-
# server_default=sa.text("(CURRENT_TIMESTAMP)"),
|
846
|
-
# nullable=False,
|
847
|
-
# ),
|
848
|
-
# sa.Column("client_ip", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
849
|
-
# sa.Column("recent_attempts", sa.Integer(), nullable=False),
|
850
|
-
# sa.PrimaryKeyConstraint("id"),
|
851
|
-
# )
|
852
|
-
# op.create_table(
|
853
|
-
# "magiclinkauthsession",
|
854
|
-
# sa.Column("id", sa.Integer(), nullable=False),
|
855
|
-
# sa.Column("email", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
856
|
-
# sa.Column("persistent_id", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
857
|
-
# sa.Column("session_token", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
858
|
-
# sa.Column(
|
859
|
-
# "created",
|
860
|
-
# sa.DateTime(timezone=True),
|
861
|
-
# server_default=sa.text("(CURRENT_TIMESTAMP)"),
|
862
|
-
# nullable=False,
|
863
|
-
# ),
|
864
|
-
# sa.Column(
|
865
|
-
# "expiration",
|
866
|
-
# sa.DateTime(timezone=True),
|
867
|
-
# server_default=sa.text("(CURRENT_TIMESTAMP)"),
|
868
|
-
# nullable=False,
|
869
|
-
# ),
|
870
|
-
# sa.PrimaryKeyConstraint("id"),
|
871
|
-
# )
|
872
|
-
# with op.batch_alter_table("magiclinkauthsession", schema=None) as batch_op:
|
873
|
-
# batch_op.create_index(
|
874
|
-
# batch_op.f("ix_magiclinkauthsession_email"), ["email"], unique=False
|
875
|
-
# )
|
876
|
-
# batch_op.create_index(
|
877
|
-
# batch_op.f("ix_magiclinkauthsession_persistent_id"),
|
878
|
-
# ["persistent_id"],
|
879
|
-
# unique=False,
|
880
|
-
# )
|
881
|
-
# batch_op.create_index(
|
882
|
-
# batch_op.f("ix_magiclinkauthsession_session_token"),
|
883
|
-
# ["session_token"],
|
884
|
-
# unique=True,
|
885
|
-
# )
|
886
|
-
|
887
|
-
|
888
848
|
class MagicLinkAuthRecord(Base):
|
889
849
|
"""
|
890
850
|
Model representing a Magic Link Auth Record.
|
File without changes
|
File without changes
|
File without changes
|