Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /rubelw_OSSS /src /OSSS /db /models /consequences.py
| 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 Consequence(UUIDMixin, Base): | |
| __tablename__ = "consequences" | |
| __allow_unmapped__ = True # keep NOTE out of the SQLAlchemy mapper | |
| NOTE: ClassVar[str] = ( | |
| "owner=student_services_school_level; " | |
| "description=Stores consequences records for the application. " | |
| "References related entities via: incident, participant. " | |
| "Includes standard audit timestamps (created_at, updated_at). " | |
| "9 column(s) defined. " | |
| "Primary key is `id`. " | |
| "2 foreign key field(s) detected." | |
| ) | |
| __table_args__ = { | |
| "comment": ( | |
| "Stores consequences records for the application. " | |
| "References related entities via: incident, participant. " | |
| "Includes standard audit timestamps (created_at, updated_at). " | |
| "9 column(s) defined. " | |
| "Primary key is `id`. " | |
| "2 foreign key field(s) detected." | |
| ), | |
| "info": { | |
| "note": NOTE, | |
| "description": ( | |
| "Stores consequences records for the application. " | |
| "References related entities via: incident, participant. " | |
| "Includes standard audit timestamps (created_at, updated_at). " | |
| "9 column(s) defined. " | |
| "Primary key is `id`. " | |
| "2 foreign key field(s) detected." | |
| ), | |
| }, | |
| } | |
| incident_id: Mapped[str] = mapped_column( | |
| GUID(), sa.ForeignKey("incidents.id", ondelete="CASCADE"), nullable=False | |
| ) | |
| participant_id: Mapped[str] = mapped_column( | |
| GUID(), sa.ForeignKey("incident_participants.id", ondelete="CASCADE"), nullable=False | |
| ) | |
| consequence_code: Mapped[str] = mapped_column( | |
| sa.Text, sa.ForeignKey("consequence_types.code", ondelete="RESTRICT"), nullable=False | |
| ) | |
| start_date: Mapped[Optional[date]] = mapped_column(sa.Date) | |
| end_date: Mapped[Optional[date]] = mapped_column(sa.Date) | |
| notes: Mapped[Optional[str]] = mapped_column(sa.Text) | |
| created_at: Mapped[datetime] = mapped_column( | |
| sa.TIMESTAMP(timezone=True), | |
| nullable=False, | |
| server_default=sa.text("CURRENT_TIMESTAMP"), | |
| ) | |
| updated_at: Mapped[datetime] = mapped_column( | |
| sa.TIMESTAMP(timezone=True), | |
| nullable=False, | |
| server_default=sa.text("CURRENT_TIMESTAMP"), | |
| onupdate=sa.text("CURRENT_TIMESTAMP"), | |
| ) | |
Xet Storage Details
- Size:
- 2.75 kB
- Xet hash:
- f9c9a7c987f507d582791ed21f9d457f360471ec81f37e42edd6bf772c94146e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.