DRYer instantiation of Forms
Using this small helper, you can instanciate your forms in an even DRYer way: form = MyForm(**form_kwargs(request)) if form.is_valid(): #...
- forms
Using this small helper, you can instanciate your forms in an even DRYer way: form = MyForm(**form_kwargs(request)) if form.is_valid(): #...
Rather than using the full GZipMiddleware, you may want to just compress some views. This decorator lets you do that. @gzip_compress def your_view(request, ...): ....
I'm finding this much more efficient (from a coding perspective) than using the `render_to_response` shortcut. It looks complex, but it's simple to use: just look at the example in the docstring. Call this script `renderer.py` and chuck it in your project root.
1. Base your test case off `ModuleTestCase` and set a class attribute containing a dictionary of modules which you want to be able to revert the values of. 2. Use `self.modulename.attribute = something` in your `setUp` method or test cases to change the module's attribute values. 3. The values will be automatically restored when each test case finishes. For the common case of reverting the settings module, just use the `SettingsTestCase` as your base class.
Handles navigation item selection. See the `nav` docstring for details.