I'm building a site in turbogears and on every page I want to see
who's logged in, a list of ppl who's birthday is today etc.
So I made widgets for these thing. But all those things are stored in
the database so I can't just include it in my template since that's
too late to fetch from the database (right?).
How would I include these on every page I've got? How can I always
return either the widgets or the data I need for the widgets?
--
kv. Halldór Rúnarsson
For an example of supplying data to every page - have a look at:
http://code.google.com/p/tg-breadcrumbs/
You will of course need to put some stuff into the master template,
that you are using, to ensure things get shown.
This should get you part way.
A
I get the following error:
File "/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg/sqlobject/dbconnection.py",
line 832, in assertActive
assert not self._obsolete, "This transaction has already gone
through ROLLBACK; begin another transaction"
AssertionError: This transaction has already gone through ROLLBACK;
begin another transaction
Error in code generated from template file
'/usr/lib/python2.5/site-packages/nfvi-1.0-py2.5.egg/nfvi/templates/login.kid'
full traceback: http://paste.turbogears.org/paste/1672
If someone knows what might be wrong that would be awesome because I
really need this...
--
kv. Halldór Rúnarsson
This seems to be a TurboJson-problem, you might consider downgrading. There is
a thread somewhere in this group, search for it.
diez
Please do respond to the list as well... at least there I don't see your post
so far.
http://www.turbogears.org/download/filelist.html
Diez