improve admin area
authorAlex Kamedov <alex@kamedov.ru>
Thu, 7 Apr 2011 06:21:27 +0000 (12:21 +0600)
committerAlex Kamedov <alex@kamedov.ru>
Thu, 7 Apr 2011 06:21:27 +0000 (12:21 +0600)
cas_provider/admin.py
cas_provider/models.py

index 5091f8e..b240d1f 100644 (file)
@@ -1,11 +1,13 @@
 from django.contrib import admin
 from django.contrib import admin
-
-from models import ServiceTicket, LoginTicket
+from models import *
 
 class ServiceTicketAdmin(admin.ModelAdmin):
 
 class ServiceTicketAdmin(admin.ModelAdmin):
-    pass
-admin.site.register(ServiceTicket, ServiceTicketAdmin)
+    list_display = ('user', 'service', 'created')
+    list_filter = ('created',)
 
 class LoginTicketAdmin(admin.ModelAdmin):
 
 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)
index 5566313..6eecc3e 100644 (file)
@@ -2,6 +2,8 @@ from django.db import models
 from django.contrib.auth.models import User
 from django.utils.translation import ugettext_lazy as _
 
 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)
 class ServiceTicket(models.Model):
     user = models.ForeignKey(User, verbose_name=_('user'))
     service = models.URLField(_('service'), verify_exists=False)