Re: [SQLObject] Inheritance looses column
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2009-09-07 11:58:26
|
[to the list...] On Mon, Sep 07, 2009 at 01:34:51PM +0200, Tobias Weber wrote: > On 07.09.2009, at 11:15, Oleg Broytmann wrote: > >> I don't think it's inconsistent. > > Well, getting a parent's column sometimes works and sometimes doesn't Yes, you have a point. > (depending on the cache?) Depending on if the entire tree of inheritable objects has been fetched. Or if you access an attribute that was or was not fetched. >> Any property is free to raise any exception. > > During normal operation descriptors are only supposed to raise > AttributeError (which this one does). Whether reading a field at that > point constitutes an allowed operation depends on the documentation of > _init. I didn't find much, but then it's a bit hard to search for ;) :( >> Looks like a bug in that library. > > http://bugs.python.org/issue1785 > > This solves my problem! Aha, that's better! > I'm still not sure if SQLObject is behaving correctly, though. What's > the point of _init if you can't access data yet? In this particular case _init is called in the middle of fetching children. InheritableIteration.next() calls obj.get() which in turn calls parent.get(), etc; every .get() calls _init, but to access all attributes you have to wait until all .get's are finished. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |