Spaces:
Running
Running
Commit
·
2eb8868
1
Parent(s):
9f0c212
fyp
Browse files- app/models/listing.py +3 -3
app/models/listing.py
CHANGED
|
@@ -9,9 +9,9 @@ from app.database import get_db
|
|
| 9 |
class Listing(BaseModel):
|
| 10 |
"""Single source of truth stored in Mongo"""
|
| 11 |
id: Optional[str] = Field(default_factory=lambda: str(ObjectId()), alias="_id")
|
| 12 |
-
user_id: str #
|
| 13 |
-
user_role: Optional[str] = None
|
| 14 |
-
listing_type: str #
|
| 15 |
title: str
|
| 16 |
description: str
|
| 17 |
price: float
|
|
|
|
| 9 |
class Listing(BaseModel):
|
| 10 |
"""Single source of truth stored in Mongo"""
|
| 11 |
id: Optional[str] = Field(default_factory=lambda: str(ObjectId()), alias="_id")
|
| 12 |
+
user_id: str # Maps to user_id in DB
|
| 13 |
+
user_role: Optional[str] = None # landlord | tenant
|
| 14 |
+
listing_type: str # Maps to listing_type in DB (rent | short-stay | roommate | sale)
|
| 15 |
title: str
|
| 16 |
description: str
|
| 17 |
price: float
|