I've started to use the FormPreview app in contrib, which has mostly worked out well (though it's a little strange to me to move all my logic into the form, rather than the view). My only issue now is with the context.
Some background: 1) Most of my URLs are backed by views, and I have context processors set up that put all kinds of useful variables in the context so the templates have direct access to them. 2) I'm heavily using template inheritance and inclusion (very DRY, eh?), and some of the base templates occur on all pages and expect certain variables to live in the context. The issue is that FormPreview works differently. It isn't a traditional view, per se, but rather generates functions that act like views, complete with context. FormPreview provides an overriddable method -- parse_params(self, *args, **kwargs) -- that allows you to take URL parameters and store them in the local 'state' dictionary, which is then passed on in the context. So now, if I want to access a context variable 'foo' in my base templates, I need to look for both 'foo' and 'state.foo'; the latter in case I'm in a FormPreview page. Anyone used the form preview code before and run into this issue? Thanks, Aaron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

