Add all preamble

This commit is contained in:
Jacob Windsor
2025-02-19 11:59:11 +01:00
parent e7ab94491f
commit 4aba2c5619
11 changed files with 123 additions and 9 deletions
+10
View File
@@ -0,0 +1,10 @@
from sqlmodel import SQLModel, Field
from uuid import uuid4
class House(SQLModel, table=True):
id: int = Field(primary_key=True, default_factory=uuid4),
address: str
city: str
country: str
price: float
description: str = None
+7
View File
@@ -0,0 +1,7 @@
from sqlmodel import SQLModel, Field
from uuid import uuid4
class Owner(SQLModel, table=True):
id: int = Field(default_factory=uuid4, primary_key=True)
name: str
email: str
-9
View File
@@ -5,15 +5,6 @@ class HousePredictionInput(BaseModel):
square_feet: float = Field(..., gt=0, description="Square footage of the house")
bedrooms: int = Field(..., ge=1, description="Number of bedrooms")
bathrooms: float = Field(..., gt=0, description="Number of bathrooms")
class Config:
json_schema_extra = {
"example": {
"square_feet": 2000,
"bedrooms": 3,
"bathrooms": 2.5
}
}
class HousePredictionOutput(BaseModel):
predicted_price: float
+7
View File
@@ -0,0 +1,7 @@
from sqlmodel import SQLModel, Field
class User(SQLModel, table=True):
id: int = Field(default=None, primary_key=True)
username: str = Field(unique=True, nullable=False)
email: str = Field(unique=True, nullable=False)
password_hash: str = Field(nullable=False)