~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlimages/admin.py

  • Committer: franku
  • Author(s): GunChleoc
  • Date: 2016-12-13 18:30:38 UTC
  • mfrom: (438.1.6 pyformat_util)
  • Revision ID: somal@arcor.de-20161213183038-5cgmvfh2fkgmoc1s
adding a script to run pyformat over the code base

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
        obj.delete()
22
22
delete_with_file.short_description = 'Delete Image including File'
23
23
 
 
24
 
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]
31
32
    fieldsets = (
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')}),
35
37
    )
36
38
 
37
39
admin.site.register(Image, ImageAdmin)