refactor models

This commit is contained in:
Laura Klünder 2016-08-29 18:49:24 +02:00
parent 752b7d6d7d
commit e8824a02d4
9 changed files with 98 additions and 84 deletions

View file

@ -0,0 +1,25 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from parler.models import TranslatedFields, TranslatableModel
class Feature(TranslatableModel):
"""
A map feature
"""
TYPES = (
('building', _('Building')),
('room', _('Room')),
('obstacle', _('Obstacle')),
)
name = models.CharField(_('feature identifier'), unique=True, max_length=50, help_text=_('e.g. noc'))
package = models.ForeignKey('Package', on_delete=models.CASCADE, related_name='features',
verbose_name=_('map package'))
type = models.CharField(max_length=50, choices=TYPES)
geometry = models.TextField()
translations = TranslatedFields(
title=models.CharField(_('package title'), max_length=50),
)