Thanks, Rajesh, that makes sense.  I'm still having an issue, though.
One value I'm trying to put into the context comes from the URL
parameters, so the context processor doesn't see it (I can't find it
in the WSGI request, which is all the context processor sees).  How
can I get the context processor to see the URL parameters?

-Aaron

On Sep 24, 12:47 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> On Sep 24, 11:41 am, Beals <[EMAIL PROTECTED]> wrote:
>
>
>
> > 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.
>
> You shouldn't have to. The view methods used internally by FormPreview
> call RequestContext which call all your
> settings.TEMPLATE_CONTEXT_PROCESSORS and add their results to the
> context dictionary. So you should just be able to access 'foo' as you
> would with any other template.
>
> What problem are you seeing if you just try to access 'foo' in such a
> template?
>
> -RD
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to