I'm using svn 1587

I'm having a similar problem and I'm pretty sure it is executing twice
on startup.  I didn't trust stanard output, so within the code, I
appended text to a file.  The code being run twice is a widget creation
function.  When its module is imported, the widget is created with info
from the db like so:

*************************************************************
# module mywidgets.py

def createMyWidget():
    # ...
    # get info from db
    file('/tmp/tglog.txt', 'ab').write('widget created \n') # Log to
file.
    print 'my_widget was created'
    return widget

my_widget = createMyWidget()
*************************************************************

Currently, this widget is being imported and used by a form widget
elsewhere like this:

from myproj.mywidgets import my_widget

form = TableForm(..., fields=[..., my_widget])

When I start up turbogears, /tmp/tglog.txt has two entries and
'my_widget was created' is on the stdout twice.  This bothers me
because it is not necessary and is making two trips to the database.

Randall


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to