Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /rubelw_OSSS /src /OSSS /db /models /calendars.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 Calendar(UUIDMixin, Base): | |
| __tablename__ = "calendars" | |
| __allow_unmapped__ = True # keep NOTE out of the SQLAlchemy mapper | |
| NOTE: ClassVar[str] = ( | |
| "owner=division_of_teaching_learning_accountability; " | |
| "description=Stores calendars records for the application. " | |
| "Key attributes include name. " | |
| "References related entities via: school. " | |
| "Includes standard audit timestamps (created_at, updated_at). " | |
| "5 column(s) defined. " | |
| "Primary key is `id`. " | |
| "1 foreign key field(s) detected." | |
| ) | |
| __table_args__ = { | |
| "comment": ( | |
| "Stores calendars records for the application. " | |
| "Key attributes include name. " | |
| "References related entities via: school. " | |
| "Includes standard audit timestamps (created_at, updated_at). " | |
| "5 column(s) defined. " | |
| "Primary key is `id`. " | |
| "1 foreign key field(s) detected." | |
| ), | |
| "info": { | |
| "note": NOTE, | |
| "description": ( | |
| "Stores calendars records for the application. " | |
| "Key attributes include name. " | |
| "References related entities via: school. " | |
| "Includes standard audit timestamps (created_at, updated_at). " | |
| "5 column(s) defined. " | |
| "Primary key is `id`. " | |
| "1 foreign key field(s) detected." | |
| ), | |
| }, | |
| } | |
| school_id: Mapped[Any] = mapped_column(GUID(), ForeignKey("schools.id", ondelete="CASCADE"), nullable=False) | |
| name: Mapped[str] = mapped_column(sa.Text, nullable=False) | |
| 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.27 kB
- Xet hash:
- 5b042afd9ec46ddfc2810f56d77296839350d0f48a9b5c122f83627a902d5d82
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.