closes #192: sort hosts and domains by name
This commit is contained in:
parent
a219573366
commit
f510713890
@ -148,6 +148,7 @@ class Domain(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('domain')
|
verbose_name = _('domain')
|
||||||
verbose_name_plural = _('domains')
|
verbose_name_plural = _('domains')
|
||||||
|
ordering = ('name', )
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
@ -257,6 +258,7 @@ class Host(models.Model):
|
|||||||
index_together = (('name', 'domain'), )
|
index_together = (('name', 'domain'), )
|
||||||
verbose_name = _('host')
|
verbose_name = _('host')
|
||||||
verbose_name_plural = _('hosts')
|
verbose_name_plural = _('hosts')
|
||||||
|
ordering = ('domain', 'name') # groupby domain and sort by name
|
||||||
|
|
||||||
def get_fqdn(self):
|
def get_fqdn(self):
|
||||||
return dnstools.FQDN(self.name, self.domain.name)
|
return dnstools.FQDN(self.name, self.domain.name)
|
||||||
@ -411,6 +413,7 @@ class RelatedHost(models.Model):
|
|||||||
unique_together = (('name', 'main_host'), )
|
unique_together = (('name', 'main_host'), )
|
||||||
verbose_name = _('related host')
|
verbose_name = _('related host')
|
||||||
verbose_name_plural = _('related hosts')
|
verbose_name_plural = _('related hosts')
|
||||||
|
ordering = ('main_host', 'name')
|
||||||
|
|
||||||
def get_fqdn(self):
|
def get_fqdn(self):
|
||||||
main = self.main_host.get_fqdn()
|
main = self.main_host.get_fqdn()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user