Skip to content

Commit

Permalink
add pop proxy model for result layers testing, #38
Browse files Browse the repository at this point in the history
  • Loading branch information
nesnoj committed May 21, 2019
1 parent 553d803 commit bd2aab8
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# caption = models.CharField(max_length=50)
# description = models.CharField(max_length=100)

####################
### Layer models ###
####################
#############################
# Layer models (status quo) #
#############################

class LayerModel(models.Model):

Expand Down Expand Up @@ -409,9 +409,28 @@ class RegInfrasAviation(LayerModel):
geom = geomodels.MultiPolygonField(srid=3035, null=True)


# ###################
# ### Data models ###
# ###################
##########################
# Layer models (results) #
##########################
# Result proxy models for serial views
import random
random.seed(1)


class RegMunPopResults(RegMun):
name = 'reg_mun_pop_result'

class Meta:
proxy = True

@property
def pop(self):
return self.mundata.pop_2017 * random.random()


###############
# Data models #
###############
# The following tables contain initial data only, data that result from
# adjustments in the tool are not saved to these tables.

Expand Down

0 comments on commit bd2aab8

Please sign in to comment.