Buckets:

download
raw
2.37 kB
from __future__ import annotations
from datetime import datetime, date, time
from decimal import Decimal
from typing import Any, Optional, List, ClassVar
import sqlalchemy as sa
from sqlalchemy import ForeignKey, UniqueConstraint, text
from sqlalchemy.orm import Mapped, mapped_column, relationship
from OSSS.db.base import Base, UUIDMixin, GUID, JSONB
class Consent(UUIDMixin, Base):
__tablename__ = "consents"
__allow_unmapped__ = True # keep NOTE out of the SQLAlchemy mapper
NOTE: ClassVar[str] = (
"owner=student_services_school_level; "
"description=Stores consents records for the application. "
"References related entities via: person. "
"Includes standard audit timestamps (created_at, updated_at). "
"8 column(s) defined. "
"Primary key is `id`. "
"1 foreign key field(s) detected."
)
__table_args__ = {
"comment": (
"Stores consents records for the application. "
"References related entities via: person. "
"Includes standard audit timestamps (created_at, updated_at). "
"8 column(s) defined. "
"Primary key is `id`. "
"1 foreign key field(s) detected."
),
"info": {
"note": NOTE,
"description": (
"Stores consents records for the application. "
"References related entities via: person. "
"Includes standard audit timestamps (created_at, updated_at). "
"8 column(s) defined. "
"Primary key is `id`. "
"1 foreign key field(s) detected."
),
},
}
person_id: Mapped[Any] = mapped_column(GUID(), ForeignKey("persons.id", ondelete="CASCADE"), nullable=False)
consent_type: Mapped[str] = mapped_column(sa.Text, nullable=False)
granted: Mapped[bool] = mapped_column(sa.Boolean, nullable=False, server_default=sa.sql.false())
effective_date: Mapped[date] = mapped_column(sa.Date, nullable=False)
expires_on: Mapped[Optional[date]] = mapped_column(sa.Date)
created_at: Mapped[datetime] = mapped_column(sa.DateTime(timezone=True), server_default=sa.func.now(), nullable=False)
updated_at: Mapped[datetime] = mapped_column(sa.DateTime(timezone=True), server_default=sa.func.now(), onupdate=sa.func.now(), nullable=False)

Xet Storage Details

Size:
2.37 kB
·
Xet hash:
2e90762d31d95ec400d0d90fdf137644c1f220117cd9f76e75f968c6a45bc9c4

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.