then pass it in as a global from teh code.py (or whatever you named it).

i use my db connection this way so i can call it from any class and use the
results on any page.

-----------------------
Visit My Sites!
www.syrbot.com | My Site
www.attackr.com | Latest Blog Posts



On Thu, Jan 28, 2010 at 3:40 AM, iltriki <[email protected]> wrote:

> > Branko already answered, and he was very clear, but just in case
> > you need some example code, take a look at this thread:
> http://groups.google.com/group/webpy/browse_thread/thread/93afa0c8eb3...
>
> Thank you guys..
> do i need to use $var or can i just use variables that i get from def?
>
> Imagine an index.html view with this:
> $def with (visitor_numbers)
>
> can i just use $context.visitor_numbers inside layout.html?
>
> Another thing..
> with this scenario, i need to replicate the call to
> get_visitor_numbers method inside every classes of my controller, and
> then pass the returned value to the views.
> Is there a more elegant way in web.py to handle this?
> Thanks
>
> Michele
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <webpy%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to