Olli Wang schrieb:
> Hi, I have a form contains "country" and "timezone" two single
> selection fields, the country has about 250 items and the timezone has
> over 300 items. When I set up these items as options and pass it to
> template, browsers taken a very long time to response(always over 10
> secs), but I tried some other other websites like google, yahoo, etc.
> They didn't take so much long time. Currently I pass no value as
> options to template and load all items by JSON, it works fine, I just
> need about 2~3 secs to get everything done. But for feeding variables
> to template, its speed is terrible. Any suggestion?
I've got no problems rendering a page in a fraction of a second with
this controller-code:
from turbogears import controllers, expose
# from model import *
# import logging
# log = logging.getLogger("testproject.controllers")
import turbogears.widgets as w
def calc_options():
return [(i, "value: %i" % i) for i in xrange(1000)]
form = w.ListForm(fields=[w.SingleSelectField(options=calc_options)])
class Root(controllers.RootController):
@expose(template="testproject.templates.welcome")
def index(self):
import time
# log.debug("Happy TurboGears Controller Responding For Duty")
return dict(now=time.ctime(), form=form)
So I presume it's some problem on your side maybe?
Diez
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---