Re: [SQLObject] Inheritance looses column

2009-09-07 Thread Oleg Broytmann
On Mon, Sep 07, 2009 at 03:58:15PM +0400, Oleg Broytmann wrote: > On Mon, Sep 07, 2009 at 01:34:51PM +0200, Tobias Weber wrote: > > 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 c

Re: [SQLObject] Inheritance looses column

2009-09-07 Thread Oleg Broytmann
[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?)

Re: [SQLObject] Inheritance looses column

2009-09-07 Thread Tobias Weber
[forgot to "Reply All"] 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 (depending on the cache?) > Any property is free to raise any exception. During normal operation descriptors are onl

Re: [SQLObject] Inheritance looses column

2009-09-07 Thread Oleg Broytmann
On Mon, Sep 07, 2009 at 09:12:14AM +0200, Tobias Weber wrote: > On 07.09.2009, at 00:29, Oleg Broytmann wrote: > > > Now, much later after _init(), the instance of class C got the > > attribute 'name'. > > I know. The problem is that dir() lists it before that, which, as I > wrote, breaks any

Re: [SQLObject] Inheritance looses column

2009-09-07 Thread Tobias Weber
On 07.09.2009, at 00:29, Oleg Broytmann wrote: > Now, much later after _init(), the instance of class C got the > attribute 'name'. I know. The problem is that dir() lists it before that, which, as I wrote, breaks any code using introspection. SQLObject passes internally inconsistent object

Re: [SQLObject] Inheritance looses column

2009-09-06 Thread Oleg Broytmann
On Mon, Sep 07, 2009 at 02:10:42AM +0400, Oleg Broytmann wrote: >Aha, now I see. I got the exception for the second time. 'name' is in > dir(self) because it came from the class, but it's not in self.__dict__. > Seems like a bug. Well, got it. Not a bug in SQLObject, but a "bug" in your exp

Re: [SQLObject] Inheritance looses column

2009-09-06 Thread Oleg Broytmann
[Answering to the list...] On Sun, Sep 06, 2009 at 11:27:12PM +0200, Tobias Weber wrote: > On 06.09.2009, at 15:33, Oleg Broytmann wrote: > >> No exception. > > That's 'cause you didn't run it twice. I wrote that the problem only > manifests when retrieving records from the database that do not

Re: [SQLObject] Inheritance looses column

2009-09-06 Thread Oleg Broytmann
On Sun, Sep 06, 2009 at 09:54:43AM +0200, Tobias Weber wrote: > class A(InheritableSQLObject): > def _init(self, *args, **kargs): > InheritableSQLObject._init(self, *args, **kargs) > print self.__class__ > if 'name' in dir(self): > # This should never fail >