Spaces:
Runtime error
Runtime error
Download backend/app/models/base.py from firebird-technologies/NoteStack-Test: direct link, hf CLI and curl.
- Browser
- Download file 516 Bytes
-
https://huggingface.co/spaces/firebird-technologies/NoteStack-Test/resolve/main/backend/app/models/base.py
- Command line
-
hf download hf://spaces/firebird-technologies/NoteStack-Test/backend/app/models/base.py
-
curl -L -o base.py https://huggingface.co/spaces/firebird-technologies/NoteStack-Test/resolve/main/backend/app/models/base.py
516 Bytes
| import uuid | |
| from datetime import UTC, datetime | |
| from sqlalchemy import DateTime, Uuid | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| def utcnow() -> datetime: | |
| return datetime.now(UTC) | |
| class IdMixin: | |
| id: Mapped[uuid.UUID] = mapped_column(Uuid, primary_key=True, default=uuid.uuid4) | |
| class TimestampMixin: | |
| created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow) | |
| updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utcnow, onupdate=utcnow) | |