In my index.py app, I have defined a global function..
def bio():
bio = db.select('bio')
return bio
then assigned it to templates,
web.template.Template.globals['bio'] = bio()
I'm doing this so that I can reference it in my base template, rather
than passing this table down through each sub template.
In my base template I have a for loop to deliver the information from
the table in my database 'bio'.
$for i in bio:
$i.bio_first
$i.bio_last
$i.bio_url
This works until I click up to four links, after that the information
disappears.
If I do,
$bio
$for i in bio:
$i.bio_first
$i.bio_last
$i.bio_url
The storage location is displayed and remains on screen, but the db
information disappears after reloading the page four times or clicking
four links.
In a nutshell, I'm trying to use this global function to display
information that is relevant to all the pages. Passing the table down
through each sub template just to use it in the main template seems
counter intuitive. Thanks for your time and help!
-Brent Lingle
--
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.