Add basic endpoints

This commit is contained in:
Jacob Windsor
2025-02-19 14:27:14 +01:00
parent e0f8112d13
commit 2e70664620
12 changed files with 77 additions and 22 deletions
+7 -6
View File
@@ -2,9 +2,10 @@ from sqlmodel import SQLModel, Field
from uuid import uuid4, UUID
class House(SQLModel, table=True):
id: UUID = Field(primary_key=True, default_factory=uuid4),
address: str
city: str
country: str
price: float
description: str = None
id: UUID = Field(primary_key=True, default_factory=uuid4)
address: str = Field()
city: str = Field()
country: str = Field()
price: float = Field()
description: str = Field()
owner_id: UUID = Field(foreign_key="owner.id")
+1 -4
View File
@@ -3,7 +3,4 @@ from uuid import uuid4, UUID
class Owner(SQLModel, table=True):
id: UUID = Field(default_factory=uuid4, primary_key=True)
name: str
email: str
# TODO add user_id
# TODO add houses
user_id: UUID = Field(foreign_key="user.id")