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

10 years ago
  1. from django.contrib import admin
  2. # Register your models here.
  3. from django.contrib.auth.admin import UserAdmin
  4. from django.contrib.auth.models import User
  5. from hc.api.models import Check
  6. class HcUserAdmin(UserAdmin):
  7. list_display = ('id', 'username', 'email', 'date_joined', 'num_checks',
  8. 'is_staff')
  9. ordering = ["-id"]
  10. def num_checks(self, user):
  11. return Check.objects.filter(user=user).count()
  12. admin.site.unregister(User)
  13. admin.site.register(User, HcUserAdmin)