Spaces:
Sleeping
Sleeping
Download db/schema.py from ashmib/user-feedback: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/spaces/ashmib/user-feedback/resolve/5750465a7c425feac08ca36efbbacccf49cb0807/db/schema.py
- Command line
-
hf download hf://spaces/ashmib/user-feedback@5750465a7c425feac08ca36efbbacccf49cb0807/db/schema.py
-
curl -L -o schema.py https://huggingface.co/spaces/ashmib/user-feedback/resolve/5750465a7c425feac08ca36efbbacccf49cb0807/db/schema.py
566 Bytes
| from pydantic import BaseModel | |
| from typing import List, Dict | |
| from datetime import datetime | |
| class Response(BaseModel): | |
| q_id: str | |
| ans: int | |
| feedback_text: str | None = None | |
| class Feedback(BaseModel): | |
| id: int | |
| user_id: str | |
| time_stamp: datetime | |
| responses: List[Response] | |
| # Override the method to serialize datetime | |
| def dict(self, *args, **kwargs): | |
| feedback_data = super().dict(*args, **kwargs) | |
| feedback_data['time_stamp'] = self.time_stamp.isoformat() # Convert datetime to ISO string | |
| return feedback_data | |