From 86745f16e7066afc20a4b1d2dbbbf0a35c7b959f Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 24 Oct 2014 11:10:30 +0000 Subject: [PATCH] Fixes on domain management0 --- TODO.md | 3 +++ orchestra/apps/bills/admin.py | 2 ++ orchestra/apps/domains/admin.py | 10 +++++++--- orchestra/apps/domains/models.py | 1 - 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/TODO.md b/TODO.md index e064b22f..a0dc9c21 100644 --- a/TODO.md +++ b/TODO.md @@ -176,3 +176,6 @@ Remember that, as always with QuerySets, any subsequent chained methods which im * REST PERMISSIONS * caching based on def text2int(textnum, numwords={}): + + +* Subdomain saving should not trigger bind slave diff --git a/orchestra/apps/bills/admin.py b/orchestra/apps/bills/admin.py index 049baf63..ad8791f1 100644 --- a/orchestra/apps/bills/admin.py +++ b/orchestra/apps/bills/admin.py @@ -205,6 +205,8 @@ class BillContactInline(admin.StackedInline): def formfield_for_dbfield(self, db_field, **kwargs): """ Make value input widget bigger """ + if db_field.name == 'name': + kwargs['widget'] = forms.TextInput(attrs={'size':'70'}) if db_field.name == 'address': kwargs['widget'] = forms.Textarea(attrs={'cols': 70, 'rows': 2}) if db_field.name == 'email_usage': diff --git a/orchestra/apps/domains/admin.py b/orchestra/apps/domains/admin.py index 9ee0ccac..ebd069d9 100644 --- a/orchestra/apps/domains/admin.py +++ b/orchestra/apps/domains/admin.py @@ -35,15 +35,19 @@ class RecordInline(admin.TabularInline): class DomainInline(admin.TabularInline): - # TODO account, and record sumary fields model = Domain - fields = ('domain_link',) - readonly_fields = ('domain_link',) + fields = ('domain_link', 'display_records', 'account_link') + readonly_fields = ('domain_link', 'display_records', 'account_link') extra = 0 verbose_name_plural = _("Subdomains") domain_link = admin_link('__unicode__') domain_link.short_description = _("Name") + account_link = admin_link('account') + + def display_records(self, domain): + return ', '.join(domain.records.values_list('type', flat=True)) + display_records.short_description = _("Declared records") def has_add_permission(self, *args, **kwargs): return False diff --git a/orchestra/apps/domains/models.py b/orchestra/apps/domains/models.py index fb76471f..fc5c9a72 100644 --- a/orchestra/apps/domains/models.py +++ b/orchestra/apps/domains/models.py @@ -145,7 +145,6 @@ class Domain(models.Model): for domain in domains.filter(name__endswith=self.name): domain.top = self domain.save(update_fields=['top']) - self.subdomains.update(account_id=self.account_id) class Record(models.Model):