I've been getting a strange error recently. I just upgraded to TG1.0
but I'm not sure if this has anything to do with this because I also
started using Ubuntu rather than Windows so the setup is all new.
On a page, I have the following code (simplified):
@turbogears.expose(format="json")
def subcategory(self, category_id):
try:
#return subcategories in the selected category via JSON
#subcategories =
SubCategory.selectBy(categoryID=int(category_id))
subcategories =
SubCategory.select(SubCategory.q.categoryID ==
category_id)
except SQLObjectNotFound:
raise cherrypy.NotFound
return dict(subcategories=subcategories)
In the code above, I have 2 lines which, in my mind, should be
identical, one with selectBy and the other with select. However, when
I access /subcategory/4?tg_format=json, the select line works perfectly
(i.e. prints out the results) while selectBy line gives the following
error:
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.2-py2.4.egg/sqlobject/dbconnection.py",
line 749, 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
Does anyone know why this is? I'm almost certain that these two lines
ran the same way before I moved the server to Ubuntu and upgraded to
TG1.0 (from TG1.0b2).
Frank
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---