Add all preamble
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user