improve gift admin

pull/1/head
eric 2014-12-22 17:49:05 -05:00
parent 2db4516505
commit 8224b9e24c
1 changed files with 6 additions and 3 deletions

View File

@ -85,7 +85,7 @@ class RightsHolderAdmin(ModelAdmin):
form = RightsHolderAdminForm
class AcqAdmin(ModelAdmin):
fields = ("expires", "refreshes", )
readonly_fields = ('work', 'user', 'lib_acq', 'watermarked')
search_fields = ['user__username']
date_hierarchy = 'created'
@ -177,9 +177,12 @@ class UserProfileAdmin(ModelAdmin):
exclude = ('user',)
class GiftAdmin(ModelAdmin):
list_display = ('giver', 'acq', 'to')
list_display = ('to', 'acq_admin_link', 'giver', )
search_fields = ('giver__username', 'to')
exclude = ('giver', 'acq',)
readonly_fields = ('giver', 'acq',)
def acq_admin_link(self, gift):
return "<a href='/admin/core/acq/%s/'>%s</a>" % (gift.acq.id, gift.acq)
acq_admin_link.allow_tags = True
class CeleryTaskAdmin(ModelAdmin):
pass