improve gift admin
parent
2db4516505
commit
8224b9e24c
9
admin.py
9
admin.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue