diff options
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 5d48dd813..1825335fd 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3130,6 +3130,19 @@ def town_child_changed(sender, **kwargs): m2m_changed.connect(town_child_changed, sender=Town.children.through) +class Area(HierarchicalType): + towns = models.ManyToManyField(Town, verbose_name=_(u"Towns"), blank=True) + parent = models.ForeignKey( + 'self', blank=True, null=True, verbose_name=_(u"Parent"), + help_text=_(u"Only four level of parent are managed.") + ) + + class Meta: + verbose_name = _(u"Area") + verbose_name_plural = _(u"Areas") + ordering = ('parent__label', 'label') + + class OperationType(GeneralType): order = models.IntegerField(_(u"Order"), default=1) preventive = models.BooleanField(_(u"Is preventive"), default=True) |