Re: Pattern for Ajax Forms using Django ModelForm and Class Based Views.

2013-02-09 Thread Yo-Yo Ma
I might be worth checking out some sort of API library, like https://github.com/orokusaki/django-jsonrpc-2-0, which will allow you to perform whatever business logic you need to, and then simply return something like {"success": True, "errors": errors_list} - your templates and ordinary views c

Pattern for Ajax Forms using Django ModelForm and Class Based Views.

2013-02-08 Thread Kelly Nicholes
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