From 0006d9a177434daef39705f638d1945a5565eb7a Mon Sep 17 00:00:00 2001 From: Alex Kamedov Date: Thu, 7 Apr 2011 12:21:27 +0600 Subject: [PATCH 1/1] improve admin area --- cas_provider/admin.py | 14 ++++++++------ cas_provider/models.py | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cas_provider/admin.py b/cas_provider/admin.py index 5091f8e..b240d1f 100644 --- a/cas_provider/admin.py +++ b/cas_provider/admin.py @@ -1,11 +1,13 @@ from django.contrib import admin - -from models import ServiceTicket, LoginTicket +from models import * class ServiceTicketAdmin(admin.ModelAdmin): - pass -admin.site.register(ServiceTicket, ServiceTicketAdmin) + list_display = ('user', 'service', 'created') + list_filter = ('created',) class LoginTicketAdmin(admin.ModelAdmin): - pass -admin.site.register(LoginTicket, LoginTicketAdmin) \ No newline at end of file + list_display = ('ticket', 'created') + list_filter = ('created',) + +admin.site.register(ServiceTicket, ServiceTicketAdmin) +admin.site.register(LoginTicket, LoginTicketAdmin) diff --git a/cas_provider/models.py b/cas_provider/models.py index 5566313..6eecc3e 100644 --- a/cas_provider/models.py +++ b/cas_provider/models.py @@ -2,6 +2,8 @@ from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ +__all__ = ['ServiceTicket', 'LoginTicket'] + class ServiceTicket(models.Model): user = models.ForeignKey(User, verbose_name=_('user')) service = models.URLField(_('service'), verify_exists=False) -- 2.20.1