You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
508 B

from django.contrib import admin
# Register your models here.
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from hc.api.models import Check
class HcUserAdmin(UserAdmin):
list_display = ('id', 'username', 'email', 'date_joined', 'num_checks',
'is_staff')
ordering = ["-id"]
def num_checks(self, user):
return Check.objects.filter(user=user).count()
admin.site.unregister(User)
admin.site.register(User, HcUserAdmin)