gestioCOF/gestion/admin.py

34 lines
546 B
Python
Raw Normal View History

from django.contrib import admin
2017-02-18 19:06:43 +01:00
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
2017-02-20 01:16:50 +01:00
from .models import Profile, Club
2017-02-18 19:06:43 +01:00
2017-02-20 01:16:50 +01:00
# ---
# The user related stuff
# ---
2017-02-18 19:06:43 +01:00
class ProfileInline(admin.StackedInline):
model = Profile
inline_classes = ["collapse open"]
class UserProfileAdmin(UserAdmin):
inlines = [
ProfileInline,
]
2017-02-20 01:16:50 +01:00
# ---
# Clubs
# ---
@admin.register(Club)
class ClubAdmin(admin.ModelAdmin):
pass
2017-02-18 19:06:43 +01:00
admin.site.unregister(User)
admin.site.register(User, UserProfileAdmin)