f3-data-models 0.1.14__tar.gz → 0.1.16__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.14
3
+ Version: 0.1.16
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
@@ -777,7 +777,7 @@ class Attendance(Base):
777
777
  innerjoin=False, cascade="expunge", secondary="users", viewonly=True
778
778
  )
779
779
  attendance_x_attendance_types: Mapped[List[Attendance_x_AttendanceType]] = (
780
- relationship(back_populates="attendance")
780
+ relationship(back_populates="attendance", cascade="expunge")
781
781
  )
782
782
  attendance_types: Mapped[List[AttendanceType]] = relationship(
783
783
  secondary="attendance_x_attendance_types",
@@ -56,7 +56,7 @@ def get_engine(echo=False) -> Engine:
56
56
  return engine
57
57
 
58
58
 
59
- def get_session(echo=True):
59
+ def get_session(echo=os.environ.get("SQL_ECHO", "False") == "True"):
60
60
  if GLOBAL_SESSION:
61
61
  return GLOBAL_SESSION
62
62
 
@@ -167,7 +167,7 @@ class DbManager:
167
167
  def update_record(cls: T, id, fields):
168
168
  session = get_session()
169
169
  try:
170
- session.query(cls).filter(cls.get_id() == id).update(
170
+ session.query(cls).filter(cls.id == id).update(
171
171
  fields, synchronize_session="fetch"
172
172
  )
173
173
  session.flush()
@@ -250,7 +250,7 @@ class DbManager:
250
250
  def delete_record(cls: T, id):
251
251
  session = get_session()
252
252
  try:
253
- session.query(cls).filter(cls.get_id() == id).delete()
253
+ session.query(cls).filter(cls.id == id).delete()
254
254
  session.flush()
255
255
  finally:
256
256
  session.commit()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "f3-data-models"
3
- version = "0.1.14"
3
+ version = "0.1.16"
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"