Re: edit form not working with imagefield
Thank you all. This plugin really did the trick http://malsup.com/jquery/form/. One line of code makes it work and you can expand from there. Worked really well. I highly recommend it for form uploads with ajax and jquery. On Jul 7, 3:02 pm, Xiong Chiamiovwrote: > On Jul 7, 1:22 pm, Adam Jenkins wrote: > > > I know that Dojo allows one to upload files with Ajax. It uses an iframe as > > a work around. > > From what I remember from when I was doing something like this a good > year ago, using an iframe is the accepted way of uploading files with > ajax. You'll find tutorials, articles and blogposts all over the net > about doing so with your favorite javascript library. > > In particular, take a look > here:http://stackoverflow.com/questions/166221/how-can-i-upload-files-asyn... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: edit form not working with imagefield
On Jul 7, 1:22 pm, Adam Jenkinswrote: > I know that Dojo allows one to upload files with Ajax. It uses an iframe as > a work around. >From what I remember from when I was doing something like this a good year ago, using an iframe is the accepted way of uploading files with ajax. You'll find tutorials, articles and blogposts all over the net about doing so with your favorite javascript library. In particular, take a look here: http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: edit form not working with imagefield
On Tue, Jul 7, 2009 at 3:19 PM, geraldcorwrote: > > Oh. That's a problem. Ok. Thanks. Am I going to have to scrap the ajax > idea if I want to edit the image? Any other workarounds? I know that Dojo allows one to upload files with Ajax. It uses an iframe as a work around. Maybe you can take something from that? http://ajaxian.com/archives/dojo-uploading-files-and-contents-with-ajax > > > Thanks for the reply. > > On Jul 7, 11:20 am, Alex Gaynor wrote: > > On Tue, Jul 7, 2009 at 12:16 PM, geraldcor wrote: > > > > > I have a form that is being added via jquery ajax. I can add a new > > > record, including images just fine. Works like a dream. However, when > > > I go to edit the form, every field will update except for the image > > > field. I choose a new image from the browse button, the filepath loads > > > up and when I submit the form, the image field does not change - the > > > table field filepath does not change. Any ideas on this one? > > > > > As as aside, in case anyone wants to tackle this one, I can't use the > > > success: portion of the jQuery.ajax() function. It just skips that > > > step. Could this be related to the imagefield not updating? > > > > > My view: > > > def edit_blog(request, blg_id): > > >a = Companyblog.objects.get(pk=blg_id) > > >if request.method == 'POST': > > >form=CompanyblogForm(request.POST, request.FILES, > > > instance=a) > > >if form.is_valid(): > > >form_data=form.save() > > >return HttpResponse("Success") > > >else: > > >form = CompanyblogForm(instance=a) > > >return render_to_response('blogedit.html', {'form': > form, > > > 'blg_id': > > > blg_id}) > > > > > I will add more code as needed. Thanks for any and all help. > > > > Ajax requests don't send file data. > > > > Alex > > > > -- > > "I disapprove of what you say, but I will defend to the death your right > to > > say it." --Voltaire > > "The people's good is the highest law."--Cicero > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: edit form not working with imagefield
Oh. That's a problem. Ok. Thanks. Am I going to have to scrap the ajax idea if I want to edit the image? Any other workarounds? Thanks for the reply. On Jul 7, 11:20 am, Alex Gaynorwrote: > On Tue, Jul 7, 2009 at 12:16 PM, geraldcor wrote: > > > I have a form that is being added via jquery ajax. I can add a new > > record, including images just fine. Works like a dream. However, when > > I go to edit the form, every field will update except for the image > > field. I choose a new image from the browse button, the filepath loads > > up and when I submit the form, the image field does not change - the > > table field filepath does not change. Any ideas on this one? > > > As as aside, in case anyone wants to tackle this one, I can't use the > > success: portion of the jQuery.ajax() function. It just skips that > > step. Could this be related to the imagefield not updating? > > > My view: > > def edit_blog(request, blg_id): > > a = Companyblog.objects.get(pk=blg_id) > > if request.method == 'POST': > > form=CompanyblogForm(request.POST, request.FILES, > > instance=a) > > if form.is_valid(): > > form_data=form.save() > > return HttpResponse("Success") > > else: > > form = CompanyblogForm(instance=a) > > return render_to_response('blogedit.html', {'form': form, > > 'blg_id': > > blg_id}) > > > I will add more code as needed. Thanks for any and all help. > > Ajax requests don't send file data. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: edit form not working with imagefield
On Tue, Jul 7, 2009 at 12:16 PM, geraldcorwrote: > > I have a form that is being added via jquery ajax. I can add a new > record, including images just fine. Works like a dream. However, when > I go to edit the form, every field will update except for the image > field. I choose a new image from the browse button, the filepath loads > up and when I submit the form, the image field does not change - the > table field filepath does not change. Any ideas on this one? > > As as aside, in case anyone wants to tackle this one, I can't use the > success: portion of the jQuery.ajax() function. It just skips that > step. Could this be related to the imagefield not updating? > > My view: > def edit_blog(request, blg_id): >a = Companyblog.objects.get(pk=blg_id) >if request.method == 'POST': >form=CompanyblogForm(request.POST, request.FILES, > instance=a) >if form.is_valid(): >form_data=form.save() >return HttpResponse("Success") >else: >form = CompanyblogForm(instance=a) >return render_to_response('blogedit.html', {'form': form, > 'blg_id': > blg_id}) > > I will add more code as needed. Thanks for any and all help. > > > Ajax requests don't send file data. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
edit form not working with imagefield
I have a form that is being added via jquery ajax. I can add a new record, including images just fine. Works like a dream. However, when I go to edit the form, every field will update except for the image field. I choose a new image from the browse button, the filepath loads up and when I submit the form, the image field does not change - the table field filepath does not change. Any ideas on this one? As as aside, in case anyone wants to tackle this one, I can't use the success: portion of the jQuery.ajax() function. It just skips that step. Could this be related to the imagefield not updating? My view: def edit_blog(request, blg_id): a = Companyblog.objects.get(pk=blg_id) if request.method == 'POST': form=CompanyblogForm(request.POST, request.FILES, instance=a) if form.is_valid(): form_data=form.save() return HttpResponse("Success") else: form = CompanyblogForm(instance=a) return render_to_response('blogedit.html', {'form': form, 'blg_id': blg_id}) I will add more code as needed. Thanks for any and all help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---