Spaces:
Sleeping
Sleeping
| from pydantic import Field | |
| from typing import Literal | |
| from .BaseModel import BaseDocument | |
| from bson import ObjectId | |
| class Destination(BaseDocument): | |
| name: str = Field("", description="Destination's name") | |
| description: str = Field("", description="Destination's description") | |
| type: str = Field("", description="Destination's type") | |
| tags: str = Field("", description="Destination's tags") | |
| image: str = Field("", description="Destination's picture") | |
| lat: float = Field(0, description="Destination's latitude") | |
| long: float = Field(0, description="Destination's longitude") | |
| exclude_weather: list[str] = Field([], description="Destination's exclude weather") | |
| created_user_id: str = Field("", description="Destination's created user") | |
| updated_user_id: str = Field("", description="Destination's updated user") | |
| model_config = { | |
| "json_schema_extra": { | |
| "example": { | |
| "name": "Hanoi", | |
| "description": "Hanoi is the capital of Vietnam", | |
| "type": "city", | |
| "tags": "Vietnam, Hanoi, Capital", | |
| "image": "https://www.google.com.vn", | |
| "lat": 0, | |
| "long": 0, | |
| "exclude_weather": ["rainy", "snowy"], | |
| "created_user_id": "1234567890", | |
| "updated_user_id": "1234567890", | |
| } | |
| } | |
| } | |