Advertisement
daniilak

models.py

Jul 11th, 2021
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.47 KB | None | 0 0
  1. from peewee import *
  2. from config import *
  3.  
  4. database = PostgresqlDatabase(dbname, **{'host': host, 'user': user, 'password': password})
  5.  
  6. class UnknownField(object):
  7.     def __init__(self, *_, **__): pass
  8.  
  9. class BaseModel(Model):
  10.     class Meta:
  11.         database = database
  12.  
  13. class ReformaOpendata(BaseModel):
  14.     id = PrimaryKeyField()
  15.     id_ref = IntegerField(null=True)
  16.     area_common_property = DoubleField(null=True)
  17.     area_id = CharField()
  18.     area_land = DoubleField(null=True)
  19.     area_non_residential = DoubleField(null=True)
  20.     area_residential = DoubleField(null=True)
  21.     area_total = DoubleField(null=True)
  22.     basement_area = DoubleField(null=True)
  23.     built_year = SmallIntegerField(null=True)
  24.     chute_count = SmallIntegerField(null=True)
  25.     chute_type = CharField(null=True)
  26.     city_id = CharField()
  27.     cold_water_type = CharField(null=True)
  28.     drainage_type = CharField(null=True)
  29.     electrical_entries_count = SmallIntegerField(null=True)
  30.     electrical_type = CharField(null=True)
  31.     elevators_count = SmallIntegerField(null=True)
  32.     energy_efficiency = CharField(null=True)
  33.     entrance_count = SmallIntegerField(null=True)
  34.     exploitation_start_year = SmallIntegerField(null=True)
  35.     firefighting_type = CharField(null=True)
  36.     floor_count_max = SmallIntegerField(null=True)
  37.     floor_count_min = SmallIntegerField(null=True)
  38.     floor_type = CharField(null=True)
  39.     foundation_type = CharField(null=True)
  40.     gas_type = CharField(null=True)
  41.     heating_type = CharField(null=True)
  42.     hot_water_type = CharField(null=True)
  43.     house_type = CharField(null=True)
  44.     houseguid = CharField()
  45.     is_alarm = CharField(null=True)
  46.     living_quarters_count = SmallIntegerField(null=True)
  47.     management_organization_id = IntegerField(null=True)
  48.     method_of_forming_overhaul_fund = CharField(null=True)
  49.     other_beautification = TextField(null=True)
  50.     parking_square = DoubleField(null=True)
  51.     playground = SmallIntegerField(null=True)
  52.     project_type = TextField(null=True)
  53.     quarters_count = SmallIntegerField(null=True)
  54.     region_id = CharField()
  55.     sewerage_cesspools_volume = DoubleField(null=True)
  56.     sewerage_type = CharField(null=True)
  57.     sportsground = SmallIntegerField(null=True)
  58.     street_id = CharField()
  59.     unliving_quarters_count = SmallIntegerField(null=True)
  60.     ventilation_type = CharField(null=True)
  61.     wall_material = CharField(null=True)
  62.  
  63.     class Meta:
  64.         table_name = 'reforma_opendata'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement