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 via email to