Files
Pinry/pinry/core/forms.py

18 lines
384 B
Python
Raw Normal View History

2013-02-21 07:43:52 +00:00
from django import forms
from django_images.models import Image
2013-02-21 07:43:52 +00:00
FIELD_NAME_MAPPING = {
'image': 'qqfile',
}
2013-02-21 07:43:52 +00:00
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)
2013-02-21 07:43:52 +00:00
class Meta:
model = Image
fields = ('image',)