Permalink
Browse files

adjustment on video admin width/height fields

  • Loading branch information...
1 parent 8af75d7 commit 6970d7c01d787f827e8828873c8ba9d71ce665f0 @pvl pvl committed Oct 26, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 filer/admin/videoadmin.py
@@ -21,9 +21,14 @@ class VideoAdmin(FileAdmin):
'classes': ('collapse',),
}),
(_('Conversion'), {
- 'fields': ('conversion_status', 'original_height','original_width','height','width',
+ 'fields': ('conversion_status', 'height','width',
'conversion_output',),
'classes': ('collapse',),
})
)
- readonly_fields = ('original_height','original_width')
+
+ def render_change_form(self, request, context, *args, **kwargs):
+ video = Video.objects.get(pk=context['object_id'])
+ context['adminform'].form.fields['width'].help_text = _('Uploaded video width %s px') % video.original_width
+ context['adminform'].form.fields['height'].help_text = _('Uploaded video height %s px') % video.original_height
+ return super(VideoAdmin, self).render_change_form(request, context, args, kwargs)

0 comments on commit 6970d7c

Please sign in to comment.