Files
Pinry/pinry/pins/forms.py

20 lines
386 B
Python
Raw Normal View History

2012-04-26 03:44:16 +00:00
from django import forms
from django_images.models import Image
2012-04-26 03:44:16 +00:00
FIELD_NAME_MAPPING = {
'image': 'qqfile',
}
class ImageForm(forms.ModelForm):
def add_prefix(self, field_name):
field_name = FIELD_NAME_MAPPING.get(field_name, field_name)
return super(ImageForm, self).add_prefix(field_name)
class Meta:
model = Image
fields = ('image',)