1 from django.contrib import admin
2 from django.contrib.auth.admin import UserAdmin
3 from django.contrib.auth.models import User
7 class ProfileInline(admin.StackedInline):
12 class CustomUserAdmin(UserAdmin):
13 inlines = (ProfileInline, )
15 def get_inline_instances(self, request, obj=None):
18 return super(CustomUserAdmin, self).get_inline_instances(request, obj)
20 admin.site.unregister(User)
21 admin.site.register(User, CustomUserAdmin)
24 @admin.register(models.Presence)
25 class PresenceAdmin(admin.ModelAdmin):
26 list_display = ['session_key', 'chunk', 'user', 'since', 'until', 'active']
27 raw_id_fields = ['chunk', 'user']