This a wizard tool similar to the one in django.contrib.formtools, but it uses a session. I hope to eventually get this into shape and contribute it to the formtools package, but for right now, here it is.
The wizard steps are broken into 2 categories:
Show Form and Submit Form
Each category has it's own hooks for manipulating the process, for instance you can short-circuit a process_submit_form() and go straight to done() via a return from preprocess_submit_form(). Sorry for the lack of documentation on this.
Here's an example urls.py entry :
`(r'^estimate/(?P<page0>\d+)/$', EstimateWizard([EstimateCustomer, EstimateJob, EstimateRoom]))`
where EstimateCustomer, Job, and Room are Form classes and EstimateWizard extends SessionFormWizard
This snippet provides a template tag that automatically replaces references to any resource you want
cached forever with a version of the file that is based on the MD5 sum. For an image, you would use
something like:
{% load utils %}
<img src="{% cacheable "/media/images/logo.png" %}"/>
To install it, put a setting in your settings.py file called "DOCUMENT_ROOT", put the python code
into a templatetag-friendly file (e.g. app/templatetags/utils.py), load that template tag, then use
either a string literal, as above, or a variable name to refer to your resource:
<img src="{% cacheable my_media_file %}"/>
The cacheable resource will be used when `DEBUG = False`, but in DEBUG mode, the path you give it will
be passed back untouched (so you don't have a proliferation of cacheable files as you develop).
Django will need write access to the directory you've specified as "DOCUMENT_ROOT" (so it can copy the original
file into a forever-cacheable version).
You'll also need to set up your webserver to serve files called "MYMD5SUMNAME.cache.(js|css|png|gif|jpg)
with an expires header that is far into the future. The goal here is to create a version of your file
that will never have to be downloaded again. If you ever change the original file, the MD5 sum will
change and the changed file's cacheable name will reflect that.
Besides simply changing the name of resources, if the file is a JavaScript or CSS file, and you've
specified `MINIFY = True`, the file will be minified using YUI compressor.