kerinin wrote:
> so let's assume two simple classes:
>
>
> class testClass(SQLObject):
> property=MultipleJoin('otherClass')
>
> class otherClass(SQLObject):
> property=MultipleJoin('testClass')
>
>
> is there an easy way to test if an instance of testClass has any
> otherClasses joined to it? it would seem like a simple matter of
> testing if instance.property, but that doesn't seem to work
>
> am i missing something here?
>
> BTW, i find the SQLObject documentation to be uncomprehensibly horrible
> - this type of thing should be easy to find in the docs.
The result set of a join is exposed as a list. If you want to test
beforehand you could do:
if len(testClass.property) > 0:
This is illustrated in the documentation, especially in the code
snippets where the list delimiters are plainly visible in results. It
is not, however, explicitly stated.
-Adam
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---