Ejemplo n.º 1
0
class Offer(models.Model):
    offer_id = models.CharField(default='', max_length=35, primary_key=True)
    city_code = models.CharField(max_length=8, default='')
    item_ids = ArrayField(models.CharField(max_length=35),
                          default=list,
                          null=True)
    offer = models.DecimalField(max_digits=6, decimal_places=3, default=0)
    offer_detail = models.TextField(default='')
    offer_tag = models.CharField(max_length=255, default='')
    servei_id = models.CharField(max_length=14, default='')
Ejemplo n.º 2
0
class Flood(models.Model):
    register_no = models.IntegerField()
    annual_dfo = models.IntegerField()
    country = models.TextField()
    began = models.DateField()
    ended = models.DateField()
    days = models.IntegerField()
    deaths = models.IntegerField()
    displaced = models.IntegerField(null=True, blank=True)
    damage_usd = models.IntegerField(null=True, blank=True)
    main_cause = models.TextField()
    severity = models.IntegerField()
    sq_km = models.DecimalField(decimal_places=9, max_digits=10)
    flood_magnitude_index = models.DecimalField(decimal_places=9,
                                                max_digits=10)
    place = models.PointField()

    def __unicode__(self):
        return '%s to %s at %s' % (self.began, self.ended, self.place)
Ejemplo n.º 3
0
class LotQuantiles(pg.View):
    sql = """
    select
        town_id,
        percentile_disc(0.20) within group (order by cast(value as numeric))
                as small_lot,
        percentile_disc(0.80) within group (order by cast(value as numeric))
                as medium_lot
    from parcel_attribute att
    join parcel_parcel p on p.gid = att.parcel_id
    where name='LOT_SIZE'
    group by town_id
    """
    town_id = models.IntegerField(primary_key=True)
    small_lot = models.DecimalField(max_digits=10, decimal_places=5)
    medium_lot = models.DecimalField(max_digits=10, decimal_places=5)

    class Meta:
        managed = False
Ejemplo n.º 4
0
class CadPrjUser(models.Model):
    prj = models.ForeignKey(Owner)
    user = models.ForeignKey(SfGuardUser)
    percentage = models.DecimalField(null=True,
                                     max_digits=18,
                                     decimal_places=2,
                                     blank=True)

    class Meta:
        db_table = u'cad_prj_user'
Ejemplo n.º 5
0
class Farmland(Feature):
    type = models.CharField(max_length=50, null=True)
    type_scag = models.CharField(max_length=50, null=True)
    county = models.CharField(max_length=50, null=True)
    year = models.IntegerField(null=True)
    acres = models.DecimalField(max_digits=14, decimal_places=2, null=True)

    class Meta(object):
        abstract = True
        app_label = 'main'
Ejemplo n.º 6
0
class ServiceArea(models.Model):
    provider = models.ForeignKey(Provider,
                                 related_name='service_areas',
                                 on_delete=models.CASCADE)
    name = models.CharField(max_length=255)
    price = models.DecimalField(decimal_places=2, max_digits=10)
    area = models.PolygonField()

    def __str__(self):
        return '%s: %s' % (self.provider, self.name)
Ejemplo n.º 7
0
class Dish(models.Model):
    group = models.ForeignKey(MenuGroup,
                              related_name='data',
                              on_delete=models.CASCADE)
    name = models.CharField(max_length=50)
    image = models.URLField()
    price = models.DecimalField(max_digits=6, decimal_places=2)

    def __str__(self) -> str:
        return f'{self.group} - {self.name}'
Ejemplo n.º 8
0
class Location(models.Model):
    """Represents the location of a weather station.
    """
    title = models.CharField(blank=True, max_length=128)
    description = models.TextField(blank=True)
    point = models.PointField()
    height = models.DecimalField(max_digits=7, decimal_places=3)

    def __str__(self):
        return force_text('{} {}'.format(self.title, self.point.tuple))
Ejemplo n.º 9
0
class Booking(models.Model):
    legacy_id = models.IntegerField(unique=True)
    legacy_name = models.CharField(max_length=255, blank=True)
    arrival = models.DateField()
    departure = models.DateField()
    details = JSONField(null=True)
    cost_total = models.DecimalField(max_digits=8,
                                     decimal_places=2,
                                     default='0.00')
    campground = models.ForeignKey('Campground', null=True)
Ejemplo n.º 10
0
class PaleoCoreStratigraphicUnitBaseClass(PaleoCoreBaseClass):
    age_ma = models.DecimalField(max_digits=10,
                                 decimal_places=5,
                                 null=True,
                                 blank=True)
    description = models.TextField(null=True, blank=True)
    facies_type = models.CharField(max_length=255, null=True, blank=True)

    class Meta:
        abstract = True
class HabitatConservationAreas(Feature):
    name = models.CharField(max_length=70, null=True)
    type = models.CharField(max_length=50, null=True)
    stage = models.CharField(max_length=15, null=True)
    acres = models.DecimalField(max_digits=14, decimal_places=2, null=True)
    notes = models.CharField(max_length=1024, null=True, blank=True)

    class Meta(object):
        abstract = True
        app_label = 'main'
Ejemplo n.º 12
0
class City(NamedModel):
    name_txt = models.TextField(default='')
    name_short = models.CharField(max_length=5)
    population = models.IntegerField()
    density = models.DecimalField(max_digits=7, decimal_places=1)
    dt = models.DateField()
    point = models.PointField()

    class Meta:
        app_label = 'layermap'
Ejemplo n.º 13
0
class Mob(models.Model):
    mobcod = models.BigIntegerField(_('mobcod'), default=0, primary_key=True)
    mobmoacod = models.ForeignKey(Moa,
                                  on_delete=models.PROTECT,
                                  db_column='mobmoacod')
    mobfec = models.DateField(_('mobfec'), default=datetime.date(1, 1, 1))
    mobrat = models.DecimalField(_('mobrat'),
                                 max_digits=15,
                                 decimal_places=6,
                                 default=0)
Ejemplo n.º 14
0
class PeopleMeasurement(models.Model):
    """PeopleMeasurement

    This models describes data coming from various sensors, such as
    counting cameras, 3D cameras and wifi sensors. The information
    contains for example people counts, direction, speed, lat/long etc.
    """

    id = models.UUIDField(primary_key=True)
    version = models.CharField(max_length=10)
    timestamp = models.DateTimeField(db_index=True)
    sensor = models.CharField(max_length=255)
    sensortype = models.CharField(max_length=255)
    latitude = models.DecimalField(max_digits=14, decimal_places=11)
    longitude = models.DecimalField(max_digits=14, decimal_places=11)
    density = models.FloatField(null=True)
    speed = models.FloatField(null=True)
    count = models.IntegerField(null=True)
    details = models.JSONField(null=True)
Ejemplo n.º 15
0
class Nepal(models.Model):
    gid = models.AutoField(primary_key=True)
    objectid = models.IntegerField(blank=True, null=True)
    dcode = models.IntegerField(blank=True, null=True)
    dist_name = models.CharField(max_length=18, blank=True, null=True)
    shape_leng = models.DecimalField(max_digits=65535,
                                     decimal_places=65535,
                                     blank=True,
                                     null=True)
    shape_area = models.DecimalField(max_digits=65535,
                                     decimal_places=65535,
                                     blank=True,
                                     null=True)
    code1 = models.SmallIntegerField(blank=True, null=True)
    geom = models.MultiPolygonField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'nepal'
Ejemplo n.º 16
0
class ElkGroveLandUseParcel(Feature):
    pidstr = models.CharField(max_length=100, null=True, blank=True)
    parcelid = models.CharField(max_length=100, null=True, blank=True)
    pid_2005 = models.CharField(max_length=100, null=True, blank=True)
    apn = models.CharField(max_length=100, null=True, blank=True)
    name = models.CharField(max_length=100, null=True, blank=True)
    plan_area = models.CharField(max_length=100, null=True, blank=True)
    land_use = models.CharField(max_length=100, null=True, blank=True)
    build_density = models.DecimalField(max_digits=14, null=True, decimal_places=4)
    zoning_code = models.CharField(max_length=100, null=True, blank=True)
    dwelling_units = models.DecimalField(max_digits=14, decimal_places=4)
    general_plan_code = models.CharField(max_length=100, null=True, blank=True)
    # land_use_definition is added dynamically to subclasses
    api_include = ['pidstr', 'parcelid', 'pid_2005', 'apn', 'name', 'plan_area', 'land_use', 'build_density',
                   'zoning_code', 'dwelling_units', 'general_plan_code']

    class Meta(object):
        abstract = True
        app_label = 'main'
Ejemplo n.º 17
0
class Concert(models.Model):
    id = models.AutoField(primary_key=True)
    artists = models.ManyToManyField(Artist)
    genre = models.CharField(max_length=100)
    min_price = models.DecimalField(decimal_places=2, max_digits=6)
    bit_link = models.URLField()
    tm_link = models.URLField()
    location = models.PointField()
    date = models.DateTimeField()
    pref_link = models.IntegerField()
Ejemplo n.º 18
0
class ServiceArea(AuditedModel, models.Model):
    name = models.CharField(max_length=70, blank=True, null=True)
    lat = models.DecimalField(max_digits=9,
                              decimal_places=6,
                              blank=True,
                              null=True)
    long = models.DecimalField(max_digits=9,
                               decimal_places=6,
                               blank=True,
                               null=True)
    location = models.PointField(default='POINT (0 0)', srid=4326)
    townie_delivery_start = models.TimeField(blank=True, null=True)
    townie_delivery_end = models.TimeField(blank=True, null=True)

    # self_delivery_start = models.TimeField(blank=True, null=True)
    # self_delivery_end = models.TimeField(blank=True, null=True)

    def __str__(self):
        return str(self.id)
Ejemplo n.º 19
0
class BuildingFloorPlanLine(gis_models.Model):
    """
    Represents the lines that compose a floor plan, such as walls, doors, and windows.
    """

    # line_type = gis_models.CharField(verbose_name=_(u"Cartography line type"), max_length=150, null=True,
    #                               blank=True, choices=PLAN_LINE_TYPE)

    short_name = gis_models.CharField(verbose_name=_("short name"),
                                      max_length=150,
                                      null=True,
                                      blank=True)
    long_name = gis_models.CharField(verbose_name=_("long name"),
                                     max_length=150,
                                     null=True,
                                     blank=True)
    # floor_number = gis_models.IntegerField(verbose_name=_(u"floor number"),null=True, blank=True)
    length = gis_models.DecimalField(verbose_name=_("gis calculated length"),
                                     max_digits=10,
                                     decimal_places=2,
                                     null=True,
                                     blank=True)
    floor_num = gis_models.FloatField(verbose_name=_("floor number"),
                                      null=True,
                                      blank=True)
    floor_name = gis_models.CharField(verbose_name=_("floor name"),
                                      max_length=200,
                                      null=True,
                                      blank=True)

    fk_line_type = gis_models.ForeignKey(LtPlanLineType,
                                         on_delete=gis_models.CASCADE,
                                         null=True,
                                         blank=True)
    fk_building_floor = gis_models.ForeignKey(BuildingFloor,
                                              on_delete=gis_models.CASCADE,
                                              null=True,
                                              blank=True)

    geom = gis_models.MultiLineStringField(srid=3857,
                                           spatial_index=True,
                                           null=True,
                                           blank=True)

    tags = ArrayField(ArrayField(gis_models.CharField(max_length=150),
                                 blank=True,
                                 null=True),
                      null=True,
                      blank=True)

    class meta:
        ordering = ['short_name']

    def __str__(self):
        return str(self.short_name) or ''
Ejemplo n.º 20
0
class LocationDistance(models.Model):
    community = models.ForeignKey('Community',
                                  on_delete=models.DO_NOTHING,
                                  related_name='distances',
                                  help_text="Community for this distance")
    location = models.ForeignKey('Location',
                                 on_delete=models.DO_NOTHING,
                                 related_name='distances')
    distance = models.DecimalField(
        null=True,
        blank=True,
        max_digits=24,
        decimal_places=4,
        help_text="Birds' eye distance from community to Location (km)")
    driving_distance = models.DecimalField(
        null=True,
        blank=True,
        max_digits=24,
        decimal_places=4,
        help_text="Driving distance from community to Location (km)")
    travel_time = models.IntegerField(
        null=True,
        blank=True,
        help_text="Travel time (in minutes) corresponding to driving distance")
    travel_time_display = models.CharField(
        null=True,
        blank=True,
        max_length=255,
        help_text=
        "Travel time, in human-readable units (e.g. 15 minutes 22 seconds)",
    )
    within_municipality = models.BooleanField(default=False)

    class Meta:
        unique_together = ('community', 'location')
        verbose_name = "Location Distance"
        verbose_name_plural = "Location Distances"
        ordering = ("id", )

    def __str__(self):
        return '{} to {}: {} km'.format(self.community.place_name,
                                        self.location.name, self.distance)
Ejemplo n.º 21
0
class KvkPersoon(models.Model):
    """
    Natuurlijk Persoon
    """
    prsid = models.DecimalField(
        primary_key=True, max_digits=18, decimal_places=0)
    datumuitschrijving = models.DecimalField(
        max_digits=8, decimal_places=0, blank=True, null=True)
    datumuitspraak = models.DecimalField(
        max_digits=8, decimal_places=0, blank=True, null=True)
    duur = models.CharField(max_length=240, blank=True, null=True)
    faillissement = models.CharField(max_length=3, blank=True, null=True)
    geboortedatum = models.DecimalField(
        max_digits=8, decimal_places=0, blank=True, null=True)
    geboorteland = models.CharField(max_length=50, blank=True, null=True)
    geboorteplaats = models.CharField(max_length=240, blank=True, null=True)
    geemigreerd = models.DecimalField(
        max_digits=8, decimal_places=0, blank=True, null=True)
    geheim = models.CharField(max_length=3, blank=True, null=True)
    geslachtsaanduiding = models.CharField(
        max_length=20, blank=True, null=True)
    geslachtsnaam = models.CharField(max_length=240, blank=True, null=True)
    handlichting = models.CharField(max_length=3, blank=True, null=True)
    huwelijksdatum = models.DecimalField(
        max_digits=8, decimal_places=0, blank=True, null=True)
    naam = models.CharField(max_length=600, blank=True, null=True)
    nummer = models.CharField(max_length=15, blank=True, null=True)
    ookgenoemd = models.CharField(max_length=600, blank=True, null=True)
    persoonsrechtsvorm = models.CharField(
        max_length=240, blank=True, null=True)
    redeninsolvatie = models.CharField(max_length=50, blank=True, null=True)
    rsin = models.CharField(max_length=9, blank=True, null=True)
    soort = models.CharField(max_length=30, blank=True, null=True)
    status = models.CharField(max_length=20, blank=True, null=True)
    toegangscode = models.DecimalField(
        max_digits=4, decimal_places=0, blank=True, null=True)
    typering = models.CharField(max_length=40, blank=True, null=True)
    uitgebreiderechtsvorm = models.CharField(
        max_length=240, blank=True, null=True)
    verkortenaam = models.CharField(max_length=60, blank=True, null=True)
    volledigenaam = models.CharField(max_length=240, blank=True, null=True)
    voornamen = models.CharField(max_length=240, blank=True, null=True)
    voorvoegselgeslachtsnaam = models.CharField(
        max_length=15, blank=True, null=True)
    prshibver = models.DecimalField(max_digits=19, decimal_places=0)
    rechtsvorm = models.CharField(max_length=50, blank=True, null=True)
    doelrechtsvorm = models.CharField(max_length=50, blank=True, null=True)
    rol = models.CharField(max_length=14, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'kvkprsm00'
Ejemplo n.º 22
0
class Country(models.Model):
    class Meta:
        managed = False
        db_table = 'gadm_country_geom'
        verbose_name_plural = "countries"

    # name = models.CharField(max_length=150)
    # iso = models.CharField(max_length=3, primary_key=True)
    # the_geom = models.GeometryField(srid=4326, dim=2, null=True, blank=True)
    # is_visible = models.BooleanField(default=True)

    gid = models.IntegerField(primary_key=True)
    id_0 = models.IntegerField(null=True, blank=True)
    iso = models.CharField(max_length=3, blank=True)
    name_engli = models.CharField(max_length=50, blank=True)
    name_iso = models.CharField(max_length=54, blank=True)
    name_fao = models.CharField(max_length=50, blank=True)
    name_local = models.CharField(max_length=54, blank=True)
    name_obsol = models.CharField(max_length=150, blank=True)
    name_varia = models.CharField(max_length=160, blank=True)
    name_nonla = models.CharField(max_length=50, blank=True)
    name_frenc = models.CharField(max_length=50, blank=True)
    name_spani = models.CharField(max_length=50, blank=True)
    name_russi = models.CharField(max_length=50, blank=True)
    name_arabi = models.CharField(max_length=50, blank=True)
    name_chine = models.CharField(max_length=50, blank=True)
    waspartof = models.CharField(max_length=100, blank=True)
    contains = models.CharField(max_length=50, blank=True)
    sovereign = models.CharField(max_length=40, blank=True)
    iso2 = models.CharField(max_length=4, blank=True)
    www = models.CharField(max_length=2, blank=True)
    fips = models.CharField(max_length=6, blank=True)
    ison = models.DecimalField(null=True, max_digits=65535,
                               decimal_places=65535, blank=True)
    validfr = models.CharField(max_length=12, blank=True)
    validto = models.CharField(max_length=10, blank=True)
    eumember = models.DecimalField(null=True, max_digits=65535,
                                   decimal_places=65535, blank=True)
    the_geom = models.GeometryField(srid=4326, dim=2, null=True, blank=True)

    def __unicode__(self):
        return '%s (%s)' % (self.name_engli, self.iso)
Ejemplo n.º 23
0
class Galet_Weights(Context):
    weight = models.DecimalField(decimal_places=2,
                                 max_digits=10,
                                 blank=True,
                                 null=True)

    class Meta:
        managed = True
        db_table = 'galet_weights'
        verbose_name_plural = "Galet Weights"
        verbose_name = "Galet Weight"
Ejemplo n.º 24
0
class RatingsHostel(models.Model):
    hostel = models.ForeignKey(Hostel, models.CASCADE, db_column='hostel')
    rating_category = models.ForeignKey(RatingCategories,
                                        models.CASCADE,
                                        db_column='rating_category',
                                        blank=True,
                                        null=True)
    rating = models.DecimalField(max_digits=3,
                                 decimal_places=1,
                                 blank=True,
                                 null=True)
Ejemplo n.º 25
0
class Prices(models.Model):
    room_type = models.ForeignKey('RoomTypes',
                                  models.CASCADE,
                                  db_column='room_type')
    hostel = models.ForeignKey(Hostel, models.CASCADE, db_column='hostel')
    room_size = models.ForeignKey('RoomSizes',
                                  models.CASCADE,
                                  db_column='room_size')
    from_date = models.DateTimeField()
    to_date = models.DateTimeField()
    price = models.DecimalField(max_digits=16, decimal_places=2)
Ejemplo n.º 26
0
class OrderDetails(models.Model):
    order = models.ForeignKey(Order, on_delete=models.CASCADE)
    job = models.ForeignKey(Jobs, on_delete=models.CASCADE)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    quantity = models.PositiveIntegerField(default=1)

    def __str__(self):
        return '{}'.format(self.id)

    def get_cost(self):
        return self.price * self.quantity
Ejemplo n.º 27
0
class Percent(models.Model):
    """
        Mixes in a percent field to many-to-many through classes that need to give each member of a set a percent of 100
    """
    percent = models.DecimalField(max_digits=21,
                                  decimal_places=20,
                                  default=0,
                                  null=False)

    class Meta:
        abstract = True
Ejemplo n.º 28
0
class SpecificPlanParcels(Feature):

    scaguid16 = models.CharField(max_length=10, null=True, blank=True)
    apn = models.CharField(max_length=15, null=True, blank=True)
    scag_sp_code16 = models.IntegerField(null=True, blank=True)
    scag_sp_secondary = models.IntegerField(null=True, blank=True)
    sp_name = models.CharField(max_length=100, null=True, blank=True)
    city_sp_code16 = models.CharField(max_length=60, null=True, blank=True)
    density = models.DecimalField(max_digits=14, decimal_places=2, null=True)
    low = models.DecimalField(max_digits=14, decimal_places=2, null=True)
    high = models.DecimalField(max_digits=14, decimal_places=2, null=True)
    year_adopted = models.CharField(max_length=10, null=True, blank=True)
    acres = models.DecimalField(max_digits=14, decimal_places=2, null=True)
    city = models.CharField(max_length=30, null=True, blank=True)
    county = models.CharField(max_length=15, null=True, blank=True)
    notes = models.CharField(max_length=1024, null=True, blank=True)

    class Meta(object):
        abstract = True
        app_label = 'main'
Ejemplo n.º 29
0
class Referral17(models.Model):
    insp_type = models.CharField(max_length=20, blank=True, null=True)
    score = models.DecimalField(max_digits=65535, decimal_places=65535, blank=True, null=True)
    state_name = models.CharField(max_length=100, blank=True, null=True)
    code = models.CharField(max_length=2, blank=True, null=True)
    geom = models.MultiPolygonField(blank=True, null=True)
    fid = models.AutoField(primary_key=True)

    class Meta:
        managed = False
        db_table = 'referral_17'
Ejemplo n.º 30
0
class Providers(models.Model):
    name = models.CharField(max_length=255, blank=True, null=True)
    email = models.CharField(max_length=255, blank=True, null=True)
    phone_number = models.CharField(max_length=255, blank=True, null=True)
    language = models.CharField(max_length=255, blank=True, null=True)
    currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
    is_deleted = models.NullBooleanField(default=False)

    class Meta:
        managed = False
        db_table = 'providers'