On Wednesday 10 January 2007 03:03, kerinin wrote:
> I'm having a problem with inheritable sqlobjects.  I have two classes,
> one of which is a subclass of another, and i want to be able to
> MultipleJoin to both of them - like so:
>
> -----------------------
> class BaseClass(InheritableSQLObject):
>       reference = ForeignKey('RefClass', default=None)
>
> class OtherClass(BaseClass):
>       reference = ForeignKey('RefClass', default=None)
>
> class RefClass(SQLObject):
>       base_classes = MultipleJoin('BaseClass',joinColumn='reference_id')
>       other_classes = MultipleJoin('OtherClass',joinColumn='reference_id')
> ----------------------
>
> the problem is that instances of OtherClass are showing up in
> RefClass.base_classes and NOT in RefClass.other_classes, as they
> should.

You can't do that this way. reference can only be used once. Rename to e.g.

other_class_reference

and then create a property on OtherClass with name reference, that does the 
getting and setting. Maybe that helps, I didn't test it though.

Diez

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

Reply via email to