|
24
|
1 |
from django.contrib import admin |
|
|
2 |
from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin |
|
|
3 |
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin |
|
|
4 |
|
|
|
5 |
from notes.models import GroupProfile, UserProfile |
|
|
6 |
|
|
|
7 |
|
|
|
8 |
# Define an inline admin descriptor for Employee model |
|
|
9 |
# which acts a bit like a singleton |
|
|
10 |
class UserProfileInline(admin.StackedInline): |
|
|
11 |
model = UserProfile |
|
|
12 |
can_delete = False |
|
|
13 |
|
|
|
14 |
# Define a new User admin |
|
|
15 |
class UserAdmin(BaseUserAdmin): |
|
|
16 |
inlines = (UserProfileInline, ) |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
class GroupProfileInline(admin.StackedInline): |
|
|
20 |
model = GroupProfile |
|
|
21 |
can_delete = False |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
class GroupAdmin(BaseGroupAdmin): |
|
|
25 |
inlines = (GroupProfileInline, ) |