Re: sessions in template (outside of views)

2008-06-30 Thread Bobby Roberts
i love you haha many thanks to all the Django programmers who have given us such an awesome platform. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: sessions in template (outside of views)

2008-06-30 Thread Arien
On Mon, Jun 30, 2008 at 3:27 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > in my view I have: > > > from django.template import RequestContext > from django.template import Template, Context > > [... session variables set here...] > > return render_to_response('step3.html', >

Re: sessions in template (outside of views)

2008-06-30 Thread Bobby Roberts
> If you have activated the request context processor, the request is > *automatically* passed to the template.  (That was the point of all > this, right?) > > So to display the value of request.session['City'], for example, you'd > use this in your template: > >   {{ request.session.City }} > >

Re: sessions in template (outside of views)

2008-06-30 Thread Arien
On Mon, Jun 30, 2008 at 8:12 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > ok i'm totally lost i guess... > > in my view i setup my session variables as such... > >request.session['Street2']=request.POST.get('Street2','') >

Re: sessions in template (outside of views)

2008-06-30 Thread Bobby Roberts
ok i'm totally lost i guess... in my view i setup my session variables as such... request.session['Street2']=request.POST.get('Street2','') request.session['City']=request.POST.get('City','') request.session['State']=request.POST.get('State','')

Re: sessions in template (outside of views)

2008-06-29 Thread Arien
On Sun, Jun 29, 2008 at 9:08 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > So I have to explicitly pass the session variables to the template to > use them? That kind of defeats the purpose of session variables > doesn't it? If they are in session we should be able to access them > easier

Re: sessions in template (outside of views)

2008-06-29 Thread Bobby Roberts
So I have to explicitly pass the session variables to the template to use them? That kind of defeats the purpose of session variables doesn't it? If they are in session we should be able to access them easier than passing them from view to template throughout our application.

Re: sessions in template (outside of views)

2008-06-28 Thread Daniel Roseman
On Jun 27, 9:33 pm, Bobby Roberts <[EMAIL PROTECTED]> wrote: > i'm trying to view session variables on the screen in a template. I > know the session variable has a value because i've tested it in my > view. I'm trying this in my template but not getting any results: > > Account #: {{

Re: sessions in template (outside of views)

2008-06-27 Thread Brandon Taylor
Hi Bobby, Typically what I do is set the value from the session into a variable that I pass into the context. #in views.py def my_action(request) account_num = request.session['AccountNum'] return render_to_response('the_template.html', {'account_num' : account_num}) #in

sessions in template (outside of views)

2008-06-27 Thread Bobby Roberts
i'm trying to view session variables on the screen in a template. I know the session variable has a value because i've tested it in my view. I'm trying this in my template but not getting any results: Account #: {{ request.session.AccountNum }} What could I be doing wrong?