orm get dict and id columns mappers updated

This commit is contained in:
2024-11-09 12:47:58 +03:00
parent df5927e5ac
commit e7a9b8c313
15 changed files with 233 additions and 129 deletions

View File

@@ -33,7 +33,7 @@ class UsersTokens(CrudCollection):
__tablename__ = "users_tokens"
__exclude__fields__ = []
user_id: Mapped[Identity] = mapped_column(ForeignKey("users.id"), nullable=False)
user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), nullable=False)
token_type: Mapped[str] = mapped_column(String(16), server_default="RememberMe")
token: Mapped[str] = mapped_column(String, server_default="")
@@ -267,13 +267,13 @@ class RelationshipDutyPeople(CrudCollection):
__exclude__fields__ = []
__access_by__ = RelationAccess.SuperAccessList
company_id: Mapped[Identity] = mapped_column(
company_id: Mapped[int] = mapped_column(
ForeignKey("companies.id"), nullable=False
) # 1, 2, 3
duties_id = mapped_column(
ForeignKey("duties.id"), nullable=False
) # duty -> (n)person Evyos LTD
member_id: Mapped[Identity] = mapped_column(
member_id: Mapped[int] = mapped_column(
ForeignKey("people.id"), nullable=False
) # 2, 3, 4
@@ -422,13 +422,13 @@ class RelationshipEmployee2PostCode(CrudCollection):
__exclude__fields__ = []
__include__fields__ = []
company_id: Mapped[Identity] = mapped_column(
company_id: Mapped[int] = mapped_column(
ForeignKey("companies.id"), nullable=True
) # 1, 2, 3
employee_id: Mapped[Identity] = mapped_column(
employee_id: Mapped[int] = mapped_column(
ForeignKey("employees.id"), nullable=False
)
member_id: Mapped[Identity] = mapped_column(
member_id: Mapped[int] = mapped_column(
ForeignKey("address_postcode.id"), nullable=False
)
@@ -450,7 +450,7 @@ class AddressPostcode(CrudCollection, SelectActionWithEmployee):
__access_by__ = []
__many__table__ = RelationshipEmployee2PostCode
street_id: Mapped[Identity] = mapped_column(ForeignKey("address_street.id"))
street_id: Mapped[int] = mapped_column(ForeignKey("address_street.id"))
street_uu_id = mapped_column(String, server_default="", comment="Street UUID")
postcode = mapped_column(String(32), nullable=False, comment="Postcode")
@@ -465,18 +465,18 @@ class Addresses(CrudCollection):
__tablename__ = "addresses"
__exclude__fields__ = []
build_number = mapped_column(String(24), nullable=False, comment="Build Number")
door_number = mapped_column(String(24), nullable=True, comment="Door Number")
floor_number = mapped_column(String(24), nullable=True, comment="Floor Number")
build_number: Mapped[str] = mapped_column(String(24), nullable=False, comment="Build Number")
door_number: Mapped[str] = mapped_column(String(24), nullable=True, comment="Door Number")
floor_number: Mapped[str] = mapped_column(String(24), nullable=True, comment="Floor Number")
comment_address = mapped_column(String, nullable=False, comment="Address")
letter_address = mapped_column(String, nullable=False, comment="Address")
short_letter_address = mapped_column(String, nullable=False, comment="Address")
comment_address: Mapped[str] = mapped_column(String, nullable=False, comment="Address")
letter_address: Mapped[str] = mapped_column(String, nullable=False, comment="Address")
short_letter_address: Mapped[str] = mapped_column(String, nullable=False, comment="Address")
latitude: Mapped[float] = mapped_column(Numeric(20, 12), server_default="0")
longitude: Mapped[float] = mapped_column(Numeric(20, 12), server_default="0")
street_id: Mapped[Identity] = mapped_column(
street_id: Mapped[int] = mapped_column(
ForeignKey("address_street.id"), nullable=False
)
street_uu_id = mapped_column(String, server_default="", comment="Street UUID")
@@ -625,7 +625,7 @@ class AddressState(CrudCollection):
BigInteger, nullable=True, comment="Address Geographic Id"
)
country_id: Mapped[Identity] = mapped_column(ForeignKey("address_country.id"))
country_id: Mapped[int] = mapped_column(ForeignKey("address_country.id"))
country_uu_id = mapped_column(String, server_default="", comment="Country UUID")
__table_args__ = (
@@ -656,7 +656,7 @@ class AddressCity(CrudCollection):
BigInteger, nullable=True, comment="Address Geographic Id"
)
state_id: Mapped[Identity] = mapped_column(ForeignKey("address_state.id"))
state_id: Mapped[int] = mapped_column(ForeignKey("address_state.id"))
state_uu_id = mapped_column(String, server_default="", comment="State UUID")
__table_args__ = (