One of my forms fails on form.is_valid()
First time I debug a Django form so I am not too sure where to look
forms.py
class ImageForm(forms.ModelForm):
def __init__(self,user,*args,**kwargs):
super(ImageForm,self ).__init__(*args,**kwargs) # populates the form
class Meta:
model = KMSImageP
fields = ('name',
'caption',
'image',
)
models.py
from photologue.models import ImageModel
class KMSImageP(ImageModel):
name = models.CharField(max_length=100)
slug = AutoSlugField(max_length=45, unique=True, populate_from='name')
num_views = models.PositiveIntegerField(editable=False, default=0)
caption = models.TextField(_('caption'), blank
I got that
>>>> image_form.__dict__['_errors']
>>>>django.forms.util.ErrorDict({'image': django.forms.util.ErrorList([<django.utils.functional.__proxy__ object at 0xecc770>])})
So I am guessing that my 'image' field (an ImageField inherited from an abstract base class) is the cause of the failure but I don't know why.
I've tried changing the type of the attributes to FileField (as my other forms use FileField to upload with no problem) but it still fails... Anyhow, I am clueless...