class DevelopmentEventHistory(Entity): using_options(tablename='development_event_history') id = Field(Integer, primary_key=True) zone = ManyToOne('Zone', colname='zone_id') building_type_id = Field(Integer) scheduled_year = Field(Integer) residential_units = Field(Integer) non_residential_sqft = Field(Integer) change_type = Field(String(1)) class Admin(EntityAdmin): verbose_name='Development Event Historie' list_display=['zone_id', 'building_type_id', 'scheduled_year', 'residential_units', 'non_residential_sqft', 'change_type'] field_attributes = dict(zone_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), building_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), scheduled_year=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1950, maximum=2050), residential_units=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0), non_residential_sqft=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0) )
class ScheduledEmploymentEvents(Entity): using_options(tablename='scheduled_employment_events') id = Field(Integer, primary_key=True) year = Field(Integer) action = Field(String(20)) attribute = Field(String(25)) #optional, required if action is 'set_value', 'add_value', 'subtract_value', or multiply_value amount = Field(Integer) #fields to identify jobs for events sector = ManyToOne('EmploymentSector', colname='sector_id') ##alternatively, use primary or computed attributes of jobs # building = ManyToOne('Building', colname='building_id') class Admin(EntityAdmin): verbose_name='Scheduled Employment Event' verbose_name_plural='Scheduled Employment Events' list_display=['year,' 'action', 'attribute', 'amount', 'sector_id'] field_attributes = dict(year=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1950, maximum=2050), amount=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0), sector_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1) )
class ScheduledDevelopmentEvents(Entity): using_options(tablename='scheduled_development_events') id = Field(Integer, primary_key=True) year = Field(Integer) action = Field(String(20)) attribute = Field(String(25)) #optional, required if action is 'set_value', 'add_value', 'subtract_value', or multiply_value amount = Field(Integer) #fields to identify buildings(location and building type) for events building = ManyToOne('Building', colname='building_id') ## alternatively, use primary or computed attributes of buildings #zone = ManyToOne('Zone', colname='zone_id') #building_type = ManyToOne('Building_type', colname='building_type_id') class Admin(EntityAdmin): verbose_name='Scheduled Development Event' list_display=['year', 'action', 'attribute', 'amount', 'building_id'] field_attributes = dict(year=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1950, maximum=2050), amount=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0), building_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1) )
class LandUseType(Entity): using_options(tablename='land_use_types') id = Field(Integer, primary_key=True, colname='land_use_type_id') description = Field(String(40)) land_use_name = Field(String(25)) unit_name = Field(String(15)) generic_land_use_type = ManyToOne('GenericLandUseType', colname='generic_land_use_type_id') class Admin(EntityAdmin): verbose_name = 'Land Use Type' list_display = [ 'land_use_type_id', 'description', 'land_use_name', 'unit_name', 'generic_land_use_type_id' ] field_attributes = dict( land_use_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), generic_land_use_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1))
class TargetVacancy(Entity): using_options(tablename='target_vacancies') id = Field(Integer, primary_key=True) year = Field(Integer) building_type = ManyToOne('BuildingType', colname='building_type_id') target_vacancy_rate = Field(Float(2)) class Admin(EntityAdmin): verbose_name = 'Target Vacancy' verbose_name_plural = 'Target Vacancies' list_display = ['year', 'building_type_id', 'target_vacancy_rate'] field_attributes = dict( year=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1950, maximum=2050), building_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), target_vacancy_rate=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0, maximum=1))
class DevelopmentTemplateComponents(Entity): using_options(tablename='development_template_components') id = Field(Integer, primary_key=True, colname='component_id') template_id = Field(Integer) building_type = ManyToOne('BuildingType', colname='building_type_id') percent_building_sqft = Field(Integer) construction_cost_per_unit = Field(Integer) building_sqft_per_unit = Field(Integer) class Admin(EntityAdmin): verbose_name = 'Development Template Component' list_display = [ 'component_id', 'template_id', 'building_type_id', 'percent_building_sqft', 'construction_cost_per_unit', 'building_sqft_per_unit' ] field_attributes = dict( component_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), template_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), building_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), percent_building_sqft=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0, maximum=100), construction_cost_per_unit=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), building_sqft_per_unit=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1))
class Parcel(Entity): using_options(tablename='parcels') id = Field(Integer, primary_key=True, colname='parcel_id') parcel_local_id = Field( Integer, index=True) #Store assessors key to merge other data land_value = Field(Integer) parcel_sqft = Field(Integer) plan_type = ManyToOne('PlanType', colname='plan_type_id') centroid_x = Field(Integer) #optional centroid_y = Field(Integer) #optional tax_exempt_flag = Field(Integer) county = ManyToOne('County', colname='county_id') zone = ManyToOne('Zone', colname='zone_id') census_tract_block = Field(String(20)) class Admin(EntityAdmin): verbose_name = 'Parcel' list_display = [ 'parcel_id', 'parcel_local_id', 'land_value', 'parcel_sqft', 'plan_type_id', 'centroid_x', 'centroid_y', 'tax_exempt_flag', # 'city', 'county_id', 'zone_id', 'census_tract_block' ] field_attributes = dict( parcel_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), land_value=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), parcel_sqft=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), plan_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), centroid_x=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), centroid_y=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), tax_exempt_flag=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0, maximum=1), county_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), zone_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), )
class Building(Entity): using_options(tablename='buildings') id = Field(Integer, primary_key=True, colname='building_id') building_quality_id = Field(Integer) building_type = ManyToOne('BuildingType', colname='building_type_id') improvement_value = Field(Integer) land_area = Field(Integer) total_building_sqft = Field(Integer) non_residential_sqft = Field(Integer) residential_units = Field(Integer) sqft_per_unit = Field(Integer) year_built = Field(Integer) stories = Field(Integer) tax_exempt = Field(Integer) parcel = ManyToOne('Parcel', colname='parcel_id') parcel_local_id = Field( Integer) #ManyToOne('Parcel', colname='parcel_local_id') class Admin(EntityAdmin): verbose_name = 'Building' list_display = [ 'building_id', 'building_quality_id', 'building_type_id', 'improvement_value', 'land_area', 'total_building_sqft', 'non_residential_sqft', 'residential_units', 'sqft_per_unit', 'year_built', 'stories', 'tax_exempt', 'parcel_id', 'parcel_local_id' ] field_attributes = dict( building_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), building_quality_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), building_type_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), improvement_value=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), land_area=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), total_building_sqft=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), non_residential_sqft=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), residential_units=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), sqft_per_unit=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), year_built=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1950, maximum=2050), stories=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1, maximum=150), tax_exempt=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=0, maximum=1), parcel_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1), parcel_local_id=dict(delegate=delegates.IntegerDelegate, calculator=False, minimum=1))