Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango form not refreshing once updated
    primarykey
    data
    text
    <p>Iam working in django forms using python. Iam facing an issue while saving editform.</p> <p>If iam saving the form with charfield and textfield changes, its working fine(refreshing with the updated content). But if i save the form by changing the imagefield and charfield, its updating but not refreshing the page.</p> <p>I want the page to be refreshed once the details updated or saved. Thanks in Advance.</p> <p>MY VIEWS.PY:</p> <pre><code>def profile_page(request,type = None): profile_list = get_object_or_404(UserProfile, visit_id = request.user.username, profile_type = type) image = UserProfile.objects.get(visit_id = request.user.username, profile_type = type).image if request.method == "POST": form = UserProfileForm(request.POST, request.FILES) if form.is_valid(): new_image = form.cleaned_data['image'] if new_image == None: current_image=form.fields['image'].initial = profile_list.image else: person = UserenaSignup.objects.get(visitid = request.user.username).id UserImage.objects.filter(username = person, profile_type = type).delete() current_image = UserImage.objects.create(username_id = person, profile_type = type, image = form.cleaned_data['image']).image UserProfile.objects.filter(visit_id = request.user.username, profile_type = type).update(username = form.cleaned_data['username'], designation = form.cleaned_data['designation'], image = current_image, ) return render_to_response('profile_page.html',locals(),context_instance = RequestContext(request)) else: form = UserProfileForm(instance = profile_list) return render_to_response('profile_page.html', locals(), context_instance=RequestContext(request)) else: form = UserProfileForm(instance = profile_list) return render_to_response('profile_page.html',locals(),context_instance = RequestContext(request)) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload