Exemplo n.º 1
0
class info(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL)
    store_code = models.CharField(max_length=100, blank=True, null=True)
    name = models.CharField(max_length=100)
    description = models.CharField(max_length=150)
    phone = models.CharField(max_length=20, default="", blank=True, null=True)
    city = models.ForeignKey(city, null=True)
    address = models.CharField(max_length=100,
                               default="",
                               blank=True,
                               null=True)
    picture = models.ImageField(
        upload_to="shopkeepers",
        blank=True,
        null=True,
        default="/shopkeepers/tiendas-placeholder.png",
    )
    type_shop = models.ForeignKey(types)
    status_verify = models.ForeignKey(statu)
    rate = models.FloatField(default=0)
    poly = models.PolygonField(blank=True, null=True)
    objects = models.GeoManager()
    min_price = models.CharField(max_length=10, blank=True)
    average_deliveries = models.CharField(max_length=10, blank=True)
    stratum = models.CharField(max_length=1, blank=True)
    min_shipping_price = models.CharField(max_length=30, blank=True)
    cat_shop = models.CharField(max_length=100, blank=True)
    date_register = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return self.name

    class Meta:
        verbose_name = 'Vendedor'
        verbose_name_plural = 'Vendedores'
Exemplo n.º 2
0
class AreaOfInterest(models.Model):
    objects = models.GeoManager()

    name = models.CharField(max_length=150)
    severity = models.CharField(max_length=2,
                                choices=Incident.SEVERITY_CHOICES,
                                default=Incident.MEDIUM)
    polygon = models.PolygonField()

    @property
    def path_expression(self):
        return '|'.join('{y},{x}'.format(x=x, y=y) for x, y in self.polygon[0])

    @property
    def geojson_feature(self):
        return Feature(geometry=loads(self.polygon.geojson),
                       id='AreaOfInterest:{pk}'.format(pk=self.pk),
                       properties={
                           'name':
                           self.name,
                           'severity':
                           self.get_severity_display(),
                           'centroid':
                           self.polygon.centroid.geojson,
                           'model':
                           'AreaOfInterest',
                           'pk':
                           self.pk,
                           'url':
                           reverse('tracker:area-of-interest-detail',
                                   kwargs={'pk': self.pk}),
                       })
Exemplo n.º 3
0
class Sage_wcel(models.Model):
    id = models.AutoField(primary_key=True)
    uarfcn = models.SmallIntegerField(blank=True, null=True)
    name = models.TextField(blank=True, null=True)
    lat_site = models.FloatField(blank=True, null=True)
    lon_site = models.FloatField(blank=True, null=True)
    az = models.SmallIntegerField(blank=True, null=True)
    bw = models.SmallIntegerField(blank=True, null=True)
    rd = models.FloatField(blank=True, null=True)
    expr1 = models.TextField(blank=True, null=True)
    bsc_rnc_mme_name = models.TextField(blank=True, null=True)
    rncid = models.IntegerField(blank=True, null=True)
    wbtsid = models.IntegerField(blank=True, null=True)
    lcrid = models.IntegerField(blank=True, null=True)
    te = models.FloatField(blank=True, null=True)
    tm = models.FloatField(blank=True, null=True)
    alt = models.FloatField(blank=True, null=True)
    priscrcode = models.IntegerField(blank=True, null=True)
    lac = models.IntegerField(blank=True, null=True)
    rac = models.IntegerField(blank=True, null=True)
    rootseqindex = models.IntegerField(blank=True, null=True)
    admincellstate = models.TextField(blank=True, null=True)
    wcelstate = models.IntegerField(blank=True, null=True)
    sector = models.PolygonField(srid=4326, blank=True,
                                 null=True)  # This field type is a guess.
    objects = GeoManager()

    class Meta:
        managed = True
        db_table = 'sage_wcel'

    def __str__(self):
        return self.name
Exemplo n.º 4
0
class StoryLineFeature(models.Model):
    name = models.CharField(max_length=200)
    geom = models.PolygonField()
    description = models.TextField(blank=True)

    def __unicode__(self):
        return self.name
Exemplo n.º 5
0
class UrbanizedSector(models.Model):
    '''
        represent a Polygon that contain all possible urbanized sectors.
    '''
    name = models.CharField(max_length=100, null=True, blank=True)
    description = models.CharField(max_length=1000, null=True, blank=True)
    polygon_representation = models.PolygonField(
        srid=4326,
        help_text='POLYGON((lon lat, lon lat, lon lat, lon lat, lon lat))')
    updated_at = models.DateTimeField(
        null=True,
        blank=True,
        default=timezone.now,
        verbose_name='urbanized_sector_updated_at')
    updated_by = models.ForeignKey(User,
                                   null=True,
                                   on_delete=models.SET_NULL,
                                   related_name='urbanized_sector_updated_by')
    created_at = models.DateTimeField(
        null=True,
        blank=True,
        default=timezone.now,
        verbose_name='urbanized_sector_created_at')
    created_by = models.ForeignKey(User,
                                   null=True,
                                   blank=True,
                                   on_delete=models.SET_NULL,
                                   related_name='urbanized_sector_created_by')
    objects = models.GeoManager()


# TO-DO agregar popularidad por cada propiedad. entity
Exemplo n.º 6
0
class Image(models.Model):
    name = models.CharField(max_length=255)
    square = models.PolygonField(null=True)
    data = models.BinaryField(null=True)

    def __str__(self):
        return self.name
Exemplo n.º 7
0
class NewDhakaCity(models.Model):
    geom = models.PolygonField(blank=True, null=True)
    landuse = models.CharField(max_length=50, blank=True, null=True)
    area_sqft = models.FloatField(blank=True, null=True)
    zone = models.CharField(max_length=50, blank=True, null=True)
    block = models.CharField(max_length=50, blank=True, null=True)
    owner_name = models.CharField(max_length=50, blank=True, null=True)
    father_field = models.CharField(
        db_column='father__', max_length=50, blank=True, null=True
    )  # Field renamed because it contained more than one '_' in a row. Field renamed because it ended with '_'.
    spouse_nam = models.CharField(max_length=50, blank=True, null=True)
    national_i = models.IntegerField(blank=True, null=True)
    tin_field = models.IntegerField(
        db_column='tin__', blank=True, null=True
    )  # Field renamed because it contained more than one '_' in a row. Field renamed because it ended with '_'.
    land_price = models.IntegerField(blank=True, null=True)
    mou_name = models.CharField(max_length=50, blank=True, null=True)
    mou_jl = models.CharField(max_length=50, blank=True, null=True)
    pur_date = models.CharField(max_length=50, blank=True, null=True)
    paid_date = models.CharField(max_length=50, blank=True, null=True)
    inst_date = models.CharField(max_length=50, blank=True, null=True)
    land_cat = models.CharField(max_length=50, blank=True, null=True)
    plot_no = models.CharField(max_length=50, blank=True, null=True)
    contact = models.CharField(max_length=50, blank=True, null=True)
    code = models.CharField(max_length=50, blank=True, null=True)
    area_bigha = models.CharField(max_length=50, blank=True, null=True)
    area_acre = models.CharField(max_length=50, blank=True, null=True)
    area_katha = models.CharField(max_length=50, blank=True, null=True)
    dimension = models.CharField(max_length=50, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'new_dhaka_city'
Exemplo n.º 8
0
class Border(models.Model):
    n03_001 = models.CharField(max_length=10,null=True,blank=True)
    n03_002 = models.CharField(max_length=20,null=True,blank=True)
    n03_003 = models.CharField(max_length=20,null=True,blank=True)
    n03_004 = models.CharField(max_length=20,null=True,blank=True)
    n03_007 = models.CharField(max_length=5,null=True,blank=True)
    geom     = models.PolygonField(srid=6668)
Exemplo n.º 9
0
class PLSS(models.Model):
    trs = models.CharField(max_length=20)
    township = models.CharField(
        'Township',
        max_length=4,
        help_text="Like ###D. Third digit: 1/4=2 1/2=5 3/4=7 Full=0.")
    range = models.CharField(
        'Range',
        max_length=4,
        help_text="Like ###D. Third digit: 1/4=2 1/2=5 3/4=7 Full=0.")
    section = models.CharField('Section', max_length=2, help_text="Like ##.")
    x = models.CharField(max_length=20)
    y = models.CharField(max_length=20)
    mix = models.CharField(max_length=20)
    miy = models.CharField(max_length=20)
    max = models.CharField(max_length=20)
    may = models.CharField(max_length=20)
    #geometry = models.MultiPointField('PLSS',srid=4326)
    geometry = models.PolygonField('Geometry', srid=4326)

    #objects = models.GeoManager()

    class Meta:
        db_table = 'django_fastrax_plss'
        verbose_name = _('PLSS')
        verbose_name_plural = _('PLSSs')
        ordering = ('trs', )

    def __unicode__(self):
        return u"%s" % (self.trs)

    def __str__(self):
        return u"%s" % (self.trs)
Exemplo n.º 10
0
class GraphicLabel(models.Model):
    GraphicType = (
        ('1', '建筑'),
        ('2', '道路'),
        ('3', '水域'),
        ('4', '耕地'),
        ('5', '大棚'),
        ('6', '草地'),
        ('7', '其他'),
        ('8', '林地'),
    )
    GraphicLabel = (('1', '拆迁'), ('2', '违建'), ('3', '疑似拆迁'), ('4', '疑似违建'))
    name = models.CharField(max_length=16)
    graphictype = models.CharField(max_length=4,
                                   choices=GraphicType)  #地物类型如建筑、森林、河流
    graphiclabel = models.CharField(max_length=4,
                                    choices=GraphicLabel)  #标注类型如拆迁、违建
    poly = models.PolygonField(
        default='POLYGON(( 10 10, 10 20, 20 20, 20 15, 10 10))')
    #context = models.TextField()#坐标数据
    discrib = models.TextField()
    square = models.FloatField(default=0)
    graphic_provide = models.ForeignKey(Myuser,
                                        on_delete=models.CASCADE,
                                        blank=True)

    createtime = models.DateTimeField(auto_now_add=True)
    foundtime = models.DateField(blank=True, default=timezone.now)
    address = models.CharField(max_length=16, default='无')
Exemplo n.º 11
0
class Building(models.Model):

    # Utente creatore dell'edificio
    utente = models.ForeignKey(User)

    # in pratica toString()
    def __unicode__(self):
        return self.nome

# creazione del percorso per il salvataggio della foto di vetrina

    def content_file_name(instance, filename):

        return '/'.join([
            'buildings',
            str(instance.utente.pk),
            str(instance.pk), 'vetrina' + generate_extension(filename)
        ])

    # caratteristiche dell'edificio (PUNTO 1)
    nome = models.CharField(max_length=200, unique=True)
    descrizione = models.TextField(max_length=1000, blank=True)
    link = models.URLField(blank=True)

    foto = ImageField(upload_to=content_file_name, blank=True)

    # Geo Django (PUNTO 2):
    posizione = models.PointField(help_text="POINT(longitude latitude)",
                                  unique=True,
                                  srid=4326,
                                  null=True,
                                  blank=True)
    geometria = models.PolygonField(
        help_text="POLYGON((longitude latitude, ..))",
        srid=4326,
        null=True,
        blank=True,
        geography=True)

    # Necessario per le geoquery
    objects = models.GeoManager()

    # declinazione magnetica di base dell'edificio (rispetto al nord di google)
    base_bearing = models.DecimalField(max_digits=9,
                                       decimal_places=6,
                                       blank=True,
                                       null=True)

    # Dati sulla posizione (usati nella ricerca)
    nazione = models.CharField(max_length=30, blank=True)
    citta = models.CharField(max_length=30, blank=True)

    # dati interni dell'applicazione points
    versione = models.IntegerField()
    data_creazione = models.DateTimeField('data creazione')
    data_update = models.DateTimeField('data update')

    # indica che il building è pronto per la visualizzazione
    pronto = models.BooleanField()
Exemplo n.º 12
0
class FeedingAreas(models.Model):

    title = models.CharField(max_length=256)
    description = models.TextField()
    geom = models.PolygonField()

    def __unicode__(self):
        return self.title
Exemplo n.º 13
0
class Shop(models.Model):
    # name = models.CharField(max_length=100)
    # location = models.PointField(srid=4326)
    # polygonn = models.PolygonField()
    # address = models.CharField(max_length=100)
    # city = models.CharField(max_length=50)
    name = models.CharField(max_length=100)
    polygonn = models.PolygonField()
Exemplo n.º 14
0
class Poligonos(models.Model):
    name = models.CharField(max_length=50)
    descripcion = models.TextField()
    geometry = models.PolygonField()
    objects = models.GeoManager()

    def __str__(self):
        return self.name
Exemplo n.º 15
0
class Zpsurbutm(models.Model):
    oid = models.IntegerField(primary_key=True)
    layer = models.CharField(max_length=50, blank=True)
    objects = models.GeoManager()
    the_geom = models.PolygonField(srid=32633)
    string = models.CharField(max_length=60, blank=True)

    class Meta:
        db_table = 'zpsurbutm'
Exemplo n.º 16
0
class farm_info(models.Model):
	house_id = models.ForeignKey(house_hold,on_delete=models.CASCADE)
	poly = models.PolygonField(default="")
	objects=models.GeoManager()
	#lat=models.DecimalField(max_digits=15, decimal_places=6)
	#lon=models.DecimalField(max_digits=15, decimal_places=6)
	area=models.DecimalField(max_digits=6, decimal_places=2)
	def __unicode__(self):
		return '%s'%(self.id)
Exemplo n.º 17
0
class Bmap(models.Model):
    name = models.TextField(max_length=500, blank=True)
    area = models.CharField(max_length=100, blank=True)
    desc = models.CharField(max_length=100, blank=True)
    polygon = models.PolygonField(default=Polygon())
    capture_time = models.DateField(default='2000-01-01')
    upload_time = models.DateField(default='2000-01-01')
    satelite = models.CharField(max_length=20, blank=True)
    download_times = models.IntegerField(default=0)
Exemplo n.º 18
0
class Planting(models.Model):
    plot = models.ForeignKey(Plot, on_delete=models.SET_NULL, null=True)
    breed = models.ForeignKey(Breed, on_delete=models.SET_NULL, null=True)
    shape = models.PolygonField(null=True, geography=True)
    no_of_plants = models.PositiveIntegerField(null=True)
    plant_date = models.DateField(null=True)
    harvest_date_projected = models.DateField(null=True)
    harvest_date_actual = models.DateField(null=True)
    harvest_date_modelled = models.DateField(null=True)
Exemplo n.º 19
0
class RasterEditEvent(BaseEvent):
    raster = models.ForeignKey(Raster, on_delete=models.CASCADE)
    value = models.FloatField(
        help_text="Absolute height (in meters) to use for the polygon")
    polygon_wkt = models.PolygonField(
        srid=4326,
        help_text=
        "The polygon to use for the raster edit in WKT format, new must be WGS84"
    )
Exemplo n.º 20
0
class GeoUSA(models.Model):
    state = models.CharField(max_length=250, default="New Jersey")
    county = models.CharField(max_length=250, blank=True, null=True)
    name = models.CharField(max_length=2500) # corresponds to the 'str' field
    zone_info = models.CharField(max_length=2500, blank=True, null=True) # corresponds to the 'str' field
    fld_id = models.CharField(max_length=250, blank=True, null=True)
    poly = models.PolygonField(srid=4269) # we want our model in a different SRID

    def __str__(self):
        return "{} - {} - {}".format(self.id, self.county, self.name)
Exemplo n.º 21
0
class RadarData(models.Model):
    fid = models.AutoField(primary_key=True)
    the_geom = models.PolygonField(blank=True, null=True)
    location = models.CharField(max_length=255, blank=True, null=True)
    ingestion = models.DateTimeField(blank=True, null=True)
    elevation = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'geoportal'
Exemplo n.º 22
0
class Booth(models.Model):
    location = models.ForeignKey(Location, on_delete=models.CASCADE)
    name = models.CharField(blank=False, null=False, max_length=255)
    boundaries = models.PolygonField(blank=True, null=True)

    class Meta:
        ordering = ['location', 'name']
        unique_together = [['location', 'name']]

    def __str__(self):
        return str(self.location) + ' -> ' + self.name
Exemplo n.º 23
0
class Sector(models.Model):
    name = models.CharField(max_length=100)
    color = models.CharField(max_length=100)
    geom = models.PolygonField(srid=4326)
    forgiven = models.BooleanField(default=False)
    objects = GeoManager()

    @property
    def printInfo(self):
        html = self.name
        return print_info_gen(html)
Exemplo n.º 24
0
class ServiceArea(Dated):
    provider = models.ForeignKey(Provider)
    name = models.CharField(max_length=255)
    poly = models.PolygonField()
    price = MoneyField(max_digits=19, decimal_places=8)

    def __str__(self):
        return self.name

    class Meta:
        ordering = ['id']
Exemplo n.º 25
0
class ProvinceBorder(models.Model):
    name = models.CharField(max_length=24)
    popname = models.CharField(max_length=24)
    code = models.CharField(max_length=12)
    type = models.BigIntegerField()
    display = models.BigIntegerField()
    x = models.FloatField()
    y = models.FloatField()
    py = models.CharField(max_length=50)
    geom = models.PolygonField(srid=4326)
    reg_id = models.CharField(max_length=50, default="")
Exemplo n.º 26
0
class Event(models.Model):
    name = models.CharField(max_length=100)
    description = models.CharField(max_length=1000)
    start_time = models.DateTimeField()
    end_time = models.DateTimeField()
    # Desired number of attendance
    attend_num = models.IntegerField(default=0)
    create_user = models.ForeignKey(User)
    poly = models.PolygonField()
    objects = models.GeoManager()
    participants = models.ManyToManyField('User', RELATED_NAME='participates')
Exemplo n.º 27
0
class Uiu(models.Model):
    oid = models.IntegerField(primary_key=True)
    foglio = models.IntegerField(null=True, blank=True)
    numero = models.CharField(max_length=15, blank=True)
    tipologia = models.CharField(max_length=50, blank=True)
    objects = models.GeoManager()
    the_geom = models.PolygonField(srid=32633)
    ici_stato = models.SmallIntegerField(null=True, blank=True)

    class Meta:
        db_table = 'uiu'
Exemplo n.º 28
0
class State(models.Model):
    name = models.CharField(max_length=20)
    test = models.CharField(max_length=20, null=True)
    best = models.CharField(max_length=20, null=True)
    jest = models.CharField(max_length=20, null=True)
    geometry = models.PolygonField()

    def __str__(self):
        return self.name

    def __unicode__(self):
        return self.name
Exemplo n.º 29
0
class Dzielnica(models.Model):
    gid = models.AutoField(primary_key=True)
    teryt = models.CharField(max_length=50)
    name = models.CharField(max_length=50)
    geometry = models.PolygonField(srid=2180)

    class Meta:
        verbose_name = "Dzielnica"
        verbose_name_plural = "Dzielnice"

    def __unicode__(self):
        return 0
Exemplo n.º 30
0
class WorldMenbers(models.Model):
    # Regular Django fields corresponding to the attributes in the
    # world borders shapefile.
    name = models.CharField(max_length=50, verbose_name='Nombre')
    image = models.ImageField(verbose_name='Imagen', blank=True, upload_to="pics/")
    poly = models.PolygonField()
    point = models.PointField()



    def __str__(self):
      return self.name