12 lines
351 B
Python
12 lines
351 B
Python
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 = Field()
|
|
city: str = Field()
|
|
country: str = Field()
|
|
price: float = Field()
|
|
description: str = Field()
|
|
owner_id: UUID = Field(foreign_key="owner.id")
|