feat: applied model mixins
IdMixin used on every table with an ID index (no changes needed to db) Timestamp and Deleted mixins applied to org and user tables. ActivatedMixin added to users.
This commit is contained in:
parent
7e1ab6c6ee
commit
c28b4dc37b
6 changed files with 60 additions and 15 deletions
|
|
@ -6,16 +6,17 @@ Models:
|
|||
street_address, street_address_line_2, post_office_box_number, address_locality, country_code, address_region, postal_code
|
||||
"""
|
||||
|
||||
from src.models import IdMixin
|
||||
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import mapped_column, Mapped
|
||||
|
||||
from src.models import CustomBase
|
||||
|
||||
|
||||
class Contact(CustomBase):
|
||||
class Contact(CustomBase, IdMixin):
|
||||
__tablename__ = "contact"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
email: Mapped[str] = mapped_column(default=None, nullable=True)
|
||||
first_name: Mapped[str] = mapped_column(default=None, nullable=True)
|
||||
last_name: Mapped[str] = mapped_column(default=None, nullable=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue