Previously, my code in the following was working fine and the ajaxSubmit request was done successfully.
$(document).ready(function() {
$('#restaurant_photo_upload').submit(function() {
var options = {
clearForm: true // clear all form fields after successful submit
};
$(this).ajaxSubmit(options);
return false;
});
$('[name=upload_restaurant_photo_btn]').click(function(){
alert("Uploading. . . .?");
$('#restaurant_photo_upload').submit();
});
The code to handler the post:
class AddRestaurantPhotoHandler(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
......
......
......
self.render(u'restaurant_profile', restaurant=restaurant, restaurant_key=restaurant_key)
Previously, after adding the ajaxSubmit() code instead of normal submit, I was able to get through the process with self.redirect. However, recently, it’s throwing me error, “object has no attribute ‘render’
If using self.render is the only workaround in this case, how do I pass additional query strings or data back to the template?
I’m confused in a sense that, I thought ajax doesn’t need to render the page again.
Currently a BlobstoreUploadHandler requires a redirect so you can pass query strings like this:
self.redirect("/restaurant_profile/%d/success" % (restaurant.key().id()))If then more variables are needed you can save it to the datastore and display it.
I asked in the google groups why we can’t make a normal render with blobstoreuploadhandler and the answer is that this requirement is removed already on production and the requirement is said the be removed with dev_appserver starting from SDK 1.5.4.
I’ve deployed a similar upload with plupload that can upload files with jquery and plugin and my javascript for the upload is