feat: Add member fields to admin
This commit is contained in:
parent
216814431b
commit
6da21a2786
@ -1,8 +1,26 @@
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from django.contrib import admin
|
||||
from .models import Animal, Species, RescueOrganization, AdoptionNotice, Location, Rule, Image, ModerationAction, Report, Member
|
||||
|
||||
from .models import Animal, Species, RescueOrganization, AdoptionNotice, Location, Rule, Image, ModerationAction, Report
|
||||
|
||||
# Define an inline admin descriptor for Employee model
|
||||
# which acts a bit like a singleton
|
||||
class MemberInline(admin.StackedInline):
|
||||
model = Member
|
||||
can_delete = False
|
||||
verbose_name_plural = "member"
|
||||
|
||||
|
||||
# Define a new User admin
|
||||
class UserAdmin(BaseUserAdmin):
|
||||
inlines = [MemberInline]
|
||||
|
||||
|
||||
# Re-register UserAdmin
|
||||
admin.site.unregister(User)
|
||||
admin.site.register(User, UserAdmin)
|
||||
|
||||
admin.site.register(Animal)
|
||||
admin.site.register(Species)
|
||||
|
Loading…
Reference in New Issue
Block a user