rewrite loadmap implementation
This commit is contained in:
parent
e074f70799
commit
995ccffc67
9 changed files with 190 additions and 182 deletions
|
@ -11,6 +11,7 @@ from ..fields import GeometryField
|
|||
|
||||
|
||||
class FeatureType(namedtuple('FeatureType', ('name', 'title', 'title_plural', 'geomtype', 'color'))):
|
||||
# noinspection PyUnusedLocal
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__()
|
||||
FEATURE_TYPES[self.name] = self
|
||||
|
@ -42,6 +43,8 @@ class Feature(models.Model):
|
|||
verbose_name=_('level'))
|
||||
geometry = GeometryField()
|
||||
|
||||
path_regex = r'^features/('+'|'.join(name for name, title in TYPES)+')/'
|
||||
|
||||
@property
|
||||
def titles(self):
|
||||
return {title.language: title.title for title in self.featuretitles.all()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue