Re: [SQLObject] SQLObject and Zope 2.7.3/2.8.0a1
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ma...> - 2004-11-26 09:32:39
|
On Fri, Nov 26, 2004 at 08:53:32AM +0100, Anders Bruun Olsen wrote: > def listPeople(self): > """Return a list of people""" > p = Backend.People.select(Backend.People.q.entity == 0) > people = list() Why not people = [] ? > for person in list(p): > people.append({"id": person.id, "name": person.name, "lived": person.lived}) > return people > > It is called from a ZPT file to get a list of authors (it's a book > database) that can be displayed. > > It works fine right after being added, but after refreshing the product > or restarting the Zope server, I get this error whenever I try to view a > page that calls that method: > > Error Type: AttributeError > Error Value: 'NoneType' object has no attribute 'iterSelect' > > According to the errorlog the error occurs on the line where I do the > for-loop, which means that the problem is the list(p) call. I am No. .select() cannot find a module or class. > guessing that this is due to persistence or something like that. I No, this is due to problems with registries. SQLObject registries are not compatible with module reloading (refresh). > Is it just 100% impossible to use SQLObject with Zope 2? It is possible, at least in Zope3. Look at http://codespeak.net/z3/sqlos/ . May be you can port it to Zope2. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |