Hi!
My problem is simple. I have template like this:
<form enctype="multipart/form-data"
action="{% url offers.views.add_offer %}" method="post">
<input type="file" name="image1" />
<input type="file" name="image2" />
<input type="submit" value="Add" />
</form>
Model looks like that:
class Image(models.Model):
image = models.ImageField(upload_to='uploads/images/offers/')
And forms like that (it uses model Image):
class ImageForm(ModelForm):
class Meta:
model = Image
And view like that:
for f in request.FILES:
# imageform:
image = ImageForm(request.POST, f)
image.save()
The problem is that I can't upload images. I want to save image in the two seperate instances od Image Model.
I have an error:
'unicode' object has no attribute 'get'
Thanks for any help and response.
Updated for provide more information