Hello,
I tinkered a little more, set up a minimal example (with RelatedJoin in
model.py) and now I'm a little bit lost.
Could please somebody take the time and try to reproduce this behavior
(to ensure that my setup is not flawed)?
Steps to reproduce:
1. create a new project (e.g. mybug)
2. add "import model" controller.py
3. define your model, include a RelatedJoin, something like:
class Language(SQLObject):
name = StringCol(alternateID=True)
paradigms = RelatedJoin('Paradigm')
class Paradigm(SQLObject):
name = StringCol(alternateID=True)
languages = RelatedJoin('Language')
4. fill in a database in devcfg.py and run 'tg-admi sql create'
5. Request a page on http://localhost:8080
6. edit controllers.py ('touch controller.py' works)
Now the server crashes! If it doesn't work repeat steps 5. and 6. some
more time (most of the time the server crashes after the first request
edit cycle, making development really hard).
Is somebody aware of any means to get more specific hints on why the
server reload fails?
If somebody is aware of a way (or workaround) to do actual development
despite using RelatedJoin, i would be happy to know about.
(server output, model.py and controllers.py are attached)
Thanks, cheers,
--
Soni Bergraj
16/Jan/2006:23:51:58 CONFIG INFO Server parameters:
16/Jan/2006:23:51:58 CONFIG INFO server.environment: development
16/Jan/2006:23:51:58 CONFIG INFO server.log_to_screen: True
16/Jan/2006:23:51:58 CONFIG INFO server.log_file:
16/Jan/2006:23:51:58 CONFIG INFO server.log_tracebacks: True
16/Jan/2006:23:51:58 CONFIG INFO server.log_request_headers: True
16/Jan/2006:23:51:58 CONFIG INFO server.protocol_version: HTTP/1.0
16/Jan/2006:23:51:58 CONFIG INFO server.socket_host:
16/Jan/2006:23:51:58 CONFIG INFO server.socket_port: 8080
16/Jan/2006:23:51:58 CONFIG INFO server.socket_file:
16/Jan/2006:23:51:58 CONFIG INFO server.reverse_dns: False
16/Jan/2006:23:51:58 CONFIG INFO server.socket_queue_size: 5
16/Jan/2006:23:51:58 CONFIG INFO server.thread_pool: 0
16/Jan/2006:23:51:58 HTTP INFO Serving HTTP on http://localhost:8080/
2006-01-16 23:52:00,479 turbokid.kidsupport DEBUG Recompiling template for
turbogears.fastdata.templates.sitetemplate
2006-01-16 23:52:00,498 turbokid.kidsupport DEBUG Recompiling template for
mybug.templates.welcome
2006-01-16 23:52:00,503 turbokid.kidsupport DEBUG Applying template
mybug.templates.welcome
127.0.0.1 - - [16/Jan/2006:23:52:00] "GET / HTTP/1.1" 200 1775
127.0.0.1 - - [16/Jan/2006:23:52:00] "GET
/tg_static/images/tg_under_the_hood.png HTTP/1.1" 304 -
16/Jan/2006:23:52:04 HTTP INFO SystemExit raised: shutting down autoreloader
16/Jan/2006:23:52:04 HTTP INFO HTTP Server shut down
16/Jan/2006:23:52:04 HTTP INFO CherryPy shut down
16/Jan/2006:23:52:04 HTTP INFO SystemExit raised: shutting down autoreloader
16/Jan/2006:23:52:04 HTTP INFO CherryPy shut down
import cherrypy
import turbogears
from turbogears import controllers
from turbogears import identity
import model
class Root(controllers.RootController):
@turbogears.expose(template="mybug.templates.welcome")
def index(self):
import time
return dict(now=time.ctime())
@turbogears.expose( html=".templates.login" )
def login( self, *args, **kw ):
if hasattr(cherrypy.request,"identity_errors"):
msg= _("You must provide your credentials before accessing this resource.")
previous_url= cherrypy.request.path
else:
msg= _("Please log in.")
previous_url= cherrypy.request.headers.get( "Referer", "/" )
cherrypy.response.status=403
return dict( message=msg, previous_url=previous_url, logging_in=True,
original_parameters=cherrypy.request.params )
@turbogears.expose()
def logout( self ):
identity.current.logout()
raise cherrypy.HTTPRedirect(turbogears.url("/"))
from sqlobject import *
from turbogears.database import PackageHub
from turbogears.identity.soprovider import TG_User, TG_Group, TG_Permission
hub = PackageHub("mybug")
__connection__ = hub
class Language(SQLObject):
name = StringCol(alternateID=True)
paradigms = RelatedJoin('Paradigm')
class Paradigm(SQLObject):
name = StringCol(alternateID=True)
languages = RelatedJoin('Language')