refactor models
This commit is contained in:
parent
752b7d6d7d
commit
e8824a02d4
9 changed files with 98 additions and 84 deletions
25
src/c3nav/mapdata/models/feature.py
Normal file
25
src/c3nav/mapdata/models/feature.py
Normal 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),
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue