mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
remove foreign key constraints on sqlmodel classes
This commit is contained in:
parent
ea2e948f72
commit
3ba4947330
1 changed files with 4 additions and 4 deletions
|
|
@ -18,8 +18,8 @@ class EpcPropertyModel(SQLModel, table=True):
|
|||
__tablename__ = "epc_property"
|
||||
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
property_id: int = Field(foreign_key="property.id", nullable=False)
|
||||
portfolio_id: int = Field(foreign_key="portfolio.id", nullable=False)
|
||||
property_id: Optional[int] = Field(default=None)
|
||||
portfolio_id: Optional[int] = Field(default=None)
|
||||
|
||||
# Identity / admin
|
||||
uprn: Optional[int] = Field(default=None)
|
||||
|
|
@ -148,8 +148,8 @@ class EpcPropertyModel(SQLModel, table=True):
|
|||
def from_epc_property_data(
|
||||
cls,
|
||||
data: EpcPropertyData,
|
||||
property_id: int,
|
||||
portfolio_id: int,
|
||||
property_id: Optional[int] = None,
|
||||
portfolio_id: Optional[int] = None,
|
||||
) -> EpcPropertyModel:
|
||||
es = data.sap_energy_source
|
||||
h = data.sap_heating
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue