comparison gpp/downloads/admin.py @ 277:d424b8bae71d

Fixing #128 and #129. Add elsewhere weblinks to search content. Add support for haystack's get_update_field() method.
author Brian Neal <bgneal@gmail.com>
date Sat, 02 Oct 2010 23:24:39 +0000
parents 27bee3ac85e6
children 6144023ebea8
comparison
equal deleted inserted replaced
276:8a46843c258f 277:d424b8bae71d
22 class PendingDownloadAdmin(admin.ModelAdmin): 22 class PendingDownloadAdmin(admin.ModelAdmin):
23 exclude = ('html', ) 23 exclude = ('html', )
24 list_display = ('title', 'user', 'category', 'date_added', 'ip_address', 'size') 24 list_display = ('title', 'user', 'category', 'date_added', 'ip_address', 'size')
25 ordering = ('date_added', ) 25 ordering = ('date_added', )
26 raw_id_fields = ('user', ) 26 raw_id_fields = ('user', )
27 readonly_fields = ('update_date', )
27 28
28 actions = ('approve_downloads', ) 29 actions = ('approve_downloads', )
29 30
30 def approve_downloads(self, request, qs): 31 def approve_downloads(self, request, qs):
31 for pending_dl in qs: 32 for pending_dl in qs:
59 list_filter = ('date_added', 'is_public', 'category', 'user', 'ip_address') 60 list_filter = ('date_added', 'is_public', 'category', 'user', 'ip_address')
60 date_hierarchy = 'date_added' 61 date_hierarchy = 'date_added'
61 ordering = ('-date_added', ) 62 ordering = ('-date_added', )
62 search_fields = ('title', 'description', 'user__username') 63 search_fields = ('title', 'description', 'user__username')
63 raw_id_fields = ('user', ) 64 raw_id_fields = ('user', )
65 readonly_fields = ('update_date', )
64 save_on_top = True 66 save_on_top = True
65 67
66 68
67 class VoteRecordAdmin(admin.ModelAdmin): 69 class VoteRecordAdmin(admin.ModelAdmin):
68 list_display = ('user', 'download', 'vote_date') 70 list_display = ('user', 'download', 'vote_date')