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
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
2 matches
Mail list logo