aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/admin.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-01-25 15:03:59 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-01-25 15:03:59 +0000
commitd0ac61da601f46e383ea865b784d347229ac41dc (patch)
tree2078ee1303a7a16237dab3168d6bf5612e9e45d6 /ctrack/organisations/admin.py
parent5a61862454339b61bd4ab50399ac1d683fb2b564 (diff)
Submodes added and other person details
Diffstat (limited to 'ctrack/organisations/admin.py')
-rw-r--r--ctrack/organisations/admin.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/ctrack/organisations/admin.py b/ctrack/organisations/admin.py
index 5ae61d5..019ec05 100644
--- a/ctrack/organisations/admin.py
+++ b/ctrack/organisations/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
-from .models import Organisation, Address, AddressType, Person, Role
+from .models import Organisation, Address, AddressType, Person, Role, Mode, Submode
# So we can get the organisation name - a reverse lookup
@@ -9,7 +9,7 @@ def get_organisation_name(person):
# We need this to ensure the column header in the admin does't read the func name
-get_organisation_name.short_description = 'Organisation'
+get_organisation_name.short_description = "Organisation"
class AddressTypeAdmin(admin.ModelAdmin):
@@ -23,21 +23,31 @@ class AddressInLine(admin.StackedInline):
class OrganisationAdmin(admin.ModelAdmin):
- inlines = [AddressInLine,]
- list_display = ('name',)
+ inlines = [AddressInLine]
+ list_display = ("name", "submode")
class PersonAdmin(admin.ModelAdmin):
model = Person
- list_display = ['name', get_organisation_name, 'email', 'mobile']
+ list_display = ["name", get_organisation_name, "email", "mobile"]
class RoleAdmin(admin.ModelAdmin):
model = Role
+class ModeAdmin(admin.ModelAdmin):
+ model = Mode
+
+
+class SubmodeAdmin(admin.ModelAdmin):
+ model = Submode
+
+
# Register your models here.
admin.site.register(Organisation, OrganisationAdmin)
admin.site.register(AddressType, AddressTypeAdmin)
admin.site.register(Role, RoleAdmin)
admin.site.register(Person, PersonAdmin)
+admin.site.register(Mode, ModeAdmin)
+admin.site.register(Submode, SubmodeAdmin)