aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/organisations')
-rw-r--r--ctrack/organisations/admin.py2
-rw-r--r--ctrack/organisations/models.py7
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"