Include widget on every page

2 views
Skip to first unread message

Halldór

unread,
Oct 3, 2007, 10:58:21 PM10/3/07
to turbo...@googlegroups.com
Hi there,

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

asm

unread,
Oct 4, 2007, 12:46:10 AM10/4/07
to TurboGears
This problem falls into several parts.

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

Halldór

unread,
Oct 4, 2007, 5:03:02 AM10/4/07
to turbo...@googlegroups.com
Thanks a lot,
However... I still get an error, maybe it's because of bad code in one
of my widgets... But...

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

Diez B. Roggisch

unread,
Oct 4, 2007, 7:17:27 AM10/4/07
to turbo...@googlegroups.com, Halldór
On Thursday 04 October 2007 11:03:02 Halldór wrote:
> Thanks a lot,
> However... I still get an error, maybe it's because of bad code in one
> of my widgets... But...
>
> I get the following error:
>
> File
> "/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg/sqlobject/dbcon
>nection.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.k
>id'
>
> full traceback: http://paste.turbogears.org/paste/1672
>
> If someone knows what might be wrong that would be awesome because I
> really need this...

This seems to be a TurboJson-problem, you might consider downgrading. There is
a thread somewhere in this group, search for it.

diez

Diez B. Roggisch

unread,
Oct 4, 2007, 10:25:45 AM10/4/07
to Halldór, TurboGears
On Thursday 04 October 2007 16:18:36 Halldór wrote:
> Ok... How do I downgrade this? I can't find TurboJson==0.9.9, can
> someone me out a bit?

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

Reply all
Reply to author
Forward
0 new messages