Checking RelatedJoin

0 views
Skip to first unread message

.M.

unread,
Dec 10, 2005, 9:23:09 PM12/10/05
to TurboGears
How do you select a set of items that don't have related joins? Or more
to the point how do you test for the existence of related objects in a
SQLObject Select?

Trying to select items from a table where there are no RelatedJoins
('sources' is a RelatedJoin back to the same table). Also tried
m.q.sources == NULL.


@turbogears.expose()
def mods(self):
m = model.Mod
return dict(selectID='mods',
options=[{'label':mod.title,
'value':mod.id}
for mod in m.select(EXISTS(m.q.sources))])

gives

raise SQLObjectNotFound, "The object %s by the ID %s does not
exist" % (self.__class__.__name__, self.id)


.M.

Reply all
Reply to author
Forward
0 new messages