Spaces:
Configuration error
Configuration error
Download backend/app/models/base.py from Sivaneshakumar/sanjeevani-api: direct link, hf CLI and curl.
- Browser
- Download file 609 Bytes
-
https://huggingface.co/spaces/Sivaneshakumar/sanjeevani-api/resolve/main/backend/app/models/base.py
- Command line
-
hf download hf://spaces/Sivaneshakumar/sanjeevani-api/backend/app/models/base.py
-
curl -L -o base.py https://huggingface.co/spaces/Sivaneshakumar/sanjeevani-api/resolve/main/backend/app/models/base.py
609 Bytes
| import uuid | |
| from datetime import datetime, timezone | |
| from sqlalchemy import Column, String, DateTime | |
| from backend.app.core.database import Base | |
| def generate_uuid() -> str: | |
| return str(uuid.uuid4()) | |
| def utc_now() -> datetime: | |
| return datetime.now(timezone.utc) | |
| class BaseModel(Base): | |
| __abstract__ = True | |
| id = Column(String(36), primary_key=True, default=generate_uuid) | |
| created_at = Column(DateTime(timezone=True), default=utc_now, nullable=False) | |
| updated_at = Column( | |
| DateTime(timezone=True), | |
| default=utc_now, | |
| onupdate=utc_now, | |
| nullable=False, | |
| ) | |