rewrite loadmap implementation

This commit is contained in:
Laura Klünder 2016-09-24 14:09:52 +02:00
parent e074f70799
commit 995ccffc67
9 changed files with 190 additions and 182 deletions

View file

@ -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()}