This site is an archive; learn more about 8 years of OpenHatch.

[OH-Dev] Problem solved for now -- Re: Trying to Use Form Validation in Class Based Generic Views

Asheesh Laroia lists at asheesh.org
Thu Mar 15 19:01:49 UTC 2012


Excerpts from Jacquie Flemming's message of Wed Mar 14 21:11:28 -0400 2012:
> done.

So...

we're trying to create a modified version of the class-based TemplateView
that takes an extra_context_data dictionary, and uses extra_context_data
to overwrite data that the get_context_data() method creates.

The idea is to let the POST handler for a view return the GET handler's
response, but to let the POST handler clobber some data in the GET handler
so that it can e.g. override the form with the user-submitted form with
validation errors.

Right now, we have to call data.update(extra_context_data) manually. It's
not the most elegant thing.

Nathan, I think you're the person here with the most class-based views
experience; I'd love your feedback as this matures. The idea is to let
people write very straightforward code as they write new training missions.

-- Asheesh.


More information about the Devel mailing list