Есть простая модель описывающая иерархию места (напрмер Дом-этаж-комната):
class SubLocation(models.Model):
location = models.CharField(max_length=32, verbose_name=_(u"location"))
parentID = models.IntegerField(null=False)
completename = models.CharField(max_length=200, verbose_name=_(u"fullname"), null=False, blank=True)
comments = models.TextField(verbose_name=_(u"comments"), null=True, blank=True)
level = models.IntegerField(null=False)
class Meta:
ordering = ['location']
verbose_name = _(u"sublocation")
verbose_name_plural = _(u"sublocations")
def __unicode__(self):
return self.completename
@models.permalink
def get_absolute_url(self):
return ('sublocation_view', [str(self.id)])
и хочется чтобы отображение это модели было как в Glpi: