blob: 36b78e19b01b24d54bdd6cbf8c9e27182bf305d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
from django import forms
from django.utils import safestring
class ImageInput(forms.FileInput):
def render(self, name, value, attrs = None):
output = '<img '
if attrs and 'image_class' in attrs:
output += 'class="%s" ' % attrs['image_class']
output += 'src="%s"/><br/>' % value
output += super(ImageInput, self).render(name, value, attrs)
return safestring.mark_safe(output)
|