diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-01-21 19:17:34 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-01-21 19:17:34 +0000 |
commit | 65fc0bacb0c08fb94f7ad5183b876f64633e37f1 (patch) | |
tree | f14b0b4132e48402598dfa2ea6cfa3ba68aaae36 | |
parent | a73b36b91b8be25b01e0e03f55d277105fd175a3 (diff) |
refining the admin site for organisations
-rw-r--r-- | ctrack/organisations/admin.py | 2 | ||||
-rw-r--r-- | ctrack/organisations/models.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ctrack/organisations/admin.py b/ctrack/organisations/admin.py index ecf67dd..686cb30 100644 --- a/ctrack/organisations/admin.py +++ b/ctrack/organisations/admin.py @@ -9,6 +9,8 @@ class AddressTypeAdmin(admin.ModelAdmin): class AddressInLine(admin.StackedInline): model = Address + max_num = 3 + extra = 1 class OrganisationAdmin(admin.ModelAdmin): diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index afc3808..727ef58 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -23,7 +23,9 @@ class Address(models.Model): organisation = models.ForeignKey( Organisation, related_name="addresses", on_delete=models.CASCADE, blank=False ) - type = models.ForeignKey(AddressType, on_delete=models.CASCADE, blank=False) + type = models.ForeignKey( + AddressType, verbose_name="Address Type", on_delete=models.CASCADE, blank=False + ) line1 = models.CharField(max_length=255) line2 = models.CharField(max_length=255) line3 = models.CharField(max_length=255) @@ -32,3 +34,6 @@ class Address(models.Model): postcode = models.CharField(max_length=10) country = models.CharField(max_length=100) other_details = models.CharField(max_length=255) + + class Meta: + verbose_name_plural = "Addresses" |