mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-30 13:10:56 +00:00
get windturbine working
This commit is contained in:
parent
261ad10937
commit
54d11e38de
4 changed files with 14 additions and 4 deletions
|
|
@ -83,8 +83,9 @@ class HubspotTodb():
|
|||
for add, file_loc in data_loc.items():
|
||||
self.data_in_sharepoint.append(surveyedDataProcessor(add, file_loc))
|
||||
|
||||
def load_all(self):
|
||||
self.gather_data_from_each_sharepoint()
|
||||
def load_all(self, fast=False):
|
||||
if fast is False:
|
||||
self.gather_data_from_each_sharepoint()
|
||||
with get_db_session() as session:
|
||||
self.load_pre_site_note(session)
|
||||
session.commit()
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ from etl.db.hubSpotLoad import HubspotTodb
|
|||
|
||||
dbLoader = HubspotTodb()
|
||||
|
||||
dbLoader.load_all()
|
||||
dbLoader.load_all()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from etl.transform.preSiteNoteTypes import (
|
|||
AssessorInfo, CompanyInfo,
|
||||
PreSiteNotesSummaryInfo, PreSiteNote,
|
||||
PropertyDescription, Dimension, HeatingType, Heating, HeatingSystemControls,
|
||||
OtherDetails,
|
||||
OtherDetails, WindTurbine
|
||||
)
|
||||
import uuid
|
||||
|
||||
|
|
@ -99,6 +99,9 @@ class surveyedDataProcessor():
|
|||
|
||||
# Other details
|
||||
otherDetails = self.get_attribute_and_load(self.pre_site_note.property_description, "otherDetails", OtherDetails, db_session)
|
||||
|
||||
# windTurbine
|
||||
windTurbine = self.get_attribute_and_load(self.pre_site_note.property_description, "windTurbine", WindTurbine, db_session)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -219,6 +219,12 @@ class PropertyDescription(BaseModel):
|
|||
showerAndBaths: Optional[ShowerAndBaths]
|
||||
flueGasHeatRecoverySystem: Optional[FlueGasHeatRecoverySystem]
|
||||
photovoltaicPanel: Optional[PhotovoltaicPanel]
|
||||
|
||||
# windTuribe
|
||||
wind_turbine_id: Optional[uuid.UUID] = Field(
|
||||
default=None,
|
||||
foreign_key="windturbine.id"
|
||||
)
|
||||
windTurbine: Optional[WindTurbine]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue