Make create house work

This commit is contained in:
Jacob Windsor
2025-02-19 14:48:56 +01:00
parent 2e70664620
commit cb8b1469cf
9 changed files with 57 additions and 20 deletions
+1 -1
View File
@@ -8,4 +8,4 @@ class House(SQLModel, table=True):
country: str = Field()
price: float = Field()
description: str = Field()
owner_id: UUID = Field(foreign_key="owner.id")
owner_id: UUID = Field(foreign_key="user.id") # TODO consider using owner.id
+1 -2
View File
@@ -2,7 +2,6 @@ from sqlmodel import SQLModel, Field
from uuid import uuid4, UUID
class User(SQLModel, table=True):
id: UUID = Field(default_factory=uuid4, primary_key=True)
username: str = Field(unique=True, nullable=False)
id: UUID = Field(default_factory=lambda: uuid4(), primary_key=True)
email: str = Field(unique=True, nullable=False)
password_hash: str = Field(nullable=False)