Skip to content

Commit

Permalink
closes #192: sort hosts and domains by name
Browse files Browse the repository at this point in the history
  • Loading branch information
hensing committed Dec 29, 2015
1 parent a219573 commit f510713
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nsupdate/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def get_bind9_algorithm(self):
class Meta:
verbose_name = _('domain')
verbose_name_plural = _('domains')
ordering = ('name', )


@python_2_unicode_compatible
Expand Down Expand Up @@ -257,6 +258,7 @@ class Meta(object):
index_together = (('name', 'domain'), )
verbose_name = _('host')
verbose_name_plural = _('hosts')
ordering = ('domain', 'name') # groupby domain and sort by name

def get_fqdn(self):
return dnstools.FQDN(self.name, self.domain.name)
Expand Down Expand Up @@ -411,6 +413,7 @@ class Meta(object):
unique_together = (('name', 'main_host'), )
verbose_name = _('related host')
verbose_name_plural = _('related hosts')
ordering = ('main_host', 'name')

def get_fqdn(self):
main = self.main_host.get_fqdn()
Expand Down

0 comments on commit f510713

Please sign in to comment.