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 Gaynor <alex.gay...@gmail.com> wrote: > On Tue, Jul 7, 2009 at 12:16 PM, geraldcor <gregco...@gmail.com> 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("<p>Success</p>") > > 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 -~----------~----~----~----~------~----~------~--~---