What's the best practice for this?  In my function based views, I'd check 
if the form is_ajax() and if so, validate the form, render_to_string it to 
a form template, and return that in a json dump along with a status code. 
 Then I check the status code to see if there are errors.  If so, I close 
the modal that the form is in, notify the user of successful addition, and 
move on.  If there are errors, I replace the form's HTML in the modal with 
the new HTML that contains the form with error messages.  This sucks 
because I have to do this for every form and for every view that I have.  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to