not required as groups are teams and managed within the app interface. also, the permissions within admin do not match what the intent of the app provides. !1
31 lines
704 B
Python
31 lines
704 B
Python
from django.contrib import admin
|
|
from django.contrib.auth.models import Group
|
|
|
|
from .models import *
|
|
|
|
admin.site.unregister(Group)
|
|
|
|
class TeamInline(admin.TabularInline):
|
|
model = Team
|
|
extra = 0
|
|
|
|
readonly_fields = ['name', 'created', 'modified']
|
|
fields = ['team_name']
|
|
|
|
fk_name = 'organization'
|
|
|
|
|
|
class OrganizationAdmin(admin.ModelAdmin):
|
|
fieldsets = [
|
|
(None, {"fields": ["name", "slug"]}),
|
|
#("Date information", {"fields": ["slug"], "classes": ["collapse"]}),
|
|
]
|
|
inlines = [TeamInline]
|
|
list_display = ["name", "created", "modified"]
|
|
list_filter = ["created"]
|
|
search_fields = ["team_name"]
|
|
|
|
|
|
admin.site.register(Organization,OrganizationAdmin)
|
|
|