diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-01-21 18:57:52 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-01-21 18:57:52 +0000 |
commit | a73b36b91b8be25b01e0e03f55d277105fd175a3 (patch) | |
tree | 826859ba887e3b04edfb60c3a046f16152ca5f3c /ctrack/organisations/admin.py | |
parent | 99ac4056b828d16babbe2dc93695a46cb60e28a4 (diff) |
using stackedinline for adding organisation/address in admin
Diffstat (limited to '')
-rw-r--r-- | ctrack/organisations/admin.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ctrack/organisations/admin.py b/ctrack/organisations/admin.py index 1f36699..ecf67dd 100644 --- a/ctrack/organisations/admin.py +++ b/ctrack/organisations/admin.py @@ -3,19 +3,18 @@ from django.contrib import admin from .models import Organisation, Address, AddressType -class OrganisationAdmin(admin.ModelAdmin): +class AddressTypeAdmin(admin.ModelAdmin): pass -class AddressTypeAdmin(admin.ModelAdmin): - pass +class AddressInLine(admin.StackedInline): + model = Address -class AddressAdmin(admin.ModelAdmin): - pass +class OrganisationAdmin(admin.ModelAdmin): + inlines = [AddressInLine,] # Register your models here. admin.site.register(Organisation, OrganisationAdmin) admin.site.register(AddressType, AddressTypeAdmin) -admin.site.register(Address, AddressAdmin) |