I think I've found some problems with the InheritableSQLObject class:

Here are my classes:
==========================
class Super(InheritableSQLObject):
        prop = StringCol(default = 'Super')

        def _get_prop(self):
                print 'returned by Super'
                print self._SO_get_prop()

class Sub(Super):
        prop = StringCol(default='Sub')

        def _get_prop(self):
                print 'returned by Sub'
                print self._SO_get_prop()
==========================

I would expect this to behave like this: instances of Sub would return
'returned by Sub','Sub' when the 'prop' property was accessed.

Here's what actually happens:
==========================
>>> s=Sub()
>>> s.prop
returned by Super
Sub
==========================

SQLObject calls Super._get_prop(), and then calls Sub._SO_get_prop().

SQLObject never calls the overloaded _get_ method, even if the Sub
class doesn't define the 'prop' property.

Am I missing something?  It doesn't seem like inheritance should behave
like this...


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to