22
22
delete_with_file.short_description = 'Delete Image including File'
24
25
class ImageAdmin(admin.ModelAdmin):
25
26
readonly_fields = ('content_object', 'content_type', 'object_id')
26
list_display = ( '__unicode__', 'date_submitted', 'content_type', 'user')
27
list_display = ('__unicode__', 'date_submitted', 'content_type', 'user')
27
28
list_filter = ('date_submitted',)
28
29
date_hierarchy = 'date_submitted'
29
30
search_fields = ('image', 'user__username')
30
31
actions = [delete_with_file]
32
(None, {'fields': ( 'image', 'name', 'date_submitted','revision')}),
33
(_('Upload data:'), { 'fields': ( 'user', 'editor_ip')}),
34
(_('Content object:'), { 'fields': ( ('content_type', 'content_object'), 'object_id')}),
33
(None, {'fields': ('image', 'name', 'date_submitted', 'revision')}),
34
(_('Upload data:'), {'fields': ('user', 'editor_ip')}),
35
(_('Content object:'), {
36
'fields': (('content_type', 'content_object'), 'object_id')}),
37
39
admin.site.register(Image, ImageAdmin)