I'm using @wkornewald 's django-nonrel and django-filetransfer on Google App Engine.
I'm able to upload files just fine, but only when the entire form is valid. If the form fails validation for any field, it completely blows up instead of returning to the user to fix the changes.
error message is:
INFO 2011-03-10 20:27:09,496 dev_appserver.py:535] Internal redirection to /admin/rr/member/add/
INFO 2011-03-10 20:27:09,662 dev_appserver_blobstore.py:328] Upload handler returned 200
ERROR 2011-03-10 20:27:09,662 dev_appserver_blobstore.py:341] Invalid upload handler response. Only 301, 302 and 303 statuses are permitted and it may not have a content body.
INFO 2011-03-10 20:27:09,680 dev_appserver.py:3317] "POST /_ah/upload/ag5kbXJvbGxpbnJlbGljc3IcCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGIkBDA HTTP/1.1" 500 -
I have a simple model that looks like this:
class Member(PhotoMixin, models.Model):
name = models.CharField(max_length=50)
name2 = models.CharField(max_length=50, blank=True)
member_since = models.DateField(blank=True, null=True)
full_size_image = models.FileField(verbose_name="Photo", upload_to='members/')
is_active = models.BooleanField(default=True)
Is there a way I can more gracefully handle this? I feel its probably because django-filetransfers wants you to post the form to the blob upload url, and that url doesnt know what to do with a failure. Should there be an intermediate step that handles most of the form and posts to the upload url if and only if the rest is valid?