I am seeing the same problem using the python 2.5 1.0.2.2 windows
install. My code looks like:
@identity.require(identity.not_anonymous())
@expose(template="noquartertg.templates.file")
@expose("json")
@identity.require(identity.not_anonymous())
def file(self, file_id):
return {'file': File.get(file_id)}
@identity.require(identity.not_anonymous())
@expose(template="noquartertg.templates.file_list")
@expose("json")
def file_list(self):
## pull up the current user
user = identity.current.user
return {'user': user,
'files': [f for f in Files.selectBy(owner=user)]}
FILE works fine in both standard web view, and tg_format=json
FILE_LIST works fine in the standard web view, but explodes when I
pass in tg_format=json:
Traceback (most recent call last):
File "c:\development\python25\lib\site-packages\cherrypy-2.2.1-
py2.5.egg\cherrypy\_cphttptools.py", line 111, in _run
cherrypy.response.finalize()
File "c:\development\python25\lib\site-packages\cherrypy-2.2.1-
py2.5.egg\cherrypy\_cphttptools.py", line 404, in finalize
content = self.collapse_body()
File "c:\development\python25\lib\site-packages\cherrypy-2.2.1-
py2.5.egg\cherrypy\_cphttptools.py", line 375, in collapse_body
newbody = ''.join([chunk for chunk in self.body])
File "c:\development\python25\lib\site-packages\cherrypy-2.2.1-
py2.5.egg\cherrypy\_cphttptools.py", line 343, in flattener
for x in input:
File "C:\Development\Python25\lib\site-packages\simplejson-1.7.1-
py2.5.egg\simplejson\encoder.py", line 297, in _iterencode
for chunk in self._iterencode_dict(o, markers):
File "C:\Development\Python25\lib\site-packages\simplejson-1.7.1-
py2.5.egg\simplejson\encoder.py", line 263, in _iterencode_dict
for chunk in self._iterencode(value, markers):
File "C:\Development\Python25\lib\site-packages\simplejson-1.7.1-
py2.5.egg\simplejson\encoder.py", line 294, in _iterencode
for chunk in self._iterencode_list(o, markers):
File "C:\Development\Python25\lib\site-packages\simplejson-1.7.1-
py2.5.egg\simplejson\encoder.py", line 192, in _iterencode_list
for chunk in self._iterencode(value, markers):
File "C:\Development\Python25\lib\site-packages\simplejson-1.7.1-
py2.5.egg\simplejson\encoder.py", line 305, in _iterencode
for chunk in self._iterencode_default(o, markers):
File "C:\Development\Python25\lib\site-packages\simplejson-1.7.1-
py2.5.egg\simplejson\encoder.py", line 311, in _iterencode_default
newobj = self.default(o)
File "c:\development\python25\lib\site-packages\turbojson-1.1-
py2.5.egg\turbojson\jsonify.py", line 71, in default
return jsonify(obj)
File "<string>", line 5, in jsonify
File "c:\development\python25\lib\site-packages\turbojson-1.1-
py2.5.egg\turbojson\jsonify.py", line 49, in jsonify_sqlobject
result[name] = getattr(obj, name)
File "<string>", line 1, in <lambda>
File "c:\development\python25\lib\site-packages\SQLObject-0.9.0-
py2.5.egg\sqlobject\main.py", line 983, in _SO_loadValue
selectResults = self._connection._SO_selectOne(self, dbNames)
File "c:\development\python25\lib\site-packages\SQLObject-0.9.0-
py2.5.egg\sqlobject\dbconnection.py", line 908, in __getattr__
self.assertActive()
File "c:\development\python25\lib\site-packages\SQLObject-0.9.0-
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
Can anyone help with this? I'd like to avoid having to downgrade/
install components of TG manually, I really enjoy the ease of the
automated 'full stack' windows install. Thanks for the help!
Todd
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---