new syntax db(db.dog_id.belongs(db.dogs.owner=='james')).select(), thanks guruyaya
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.4 (2012-02-09 11:15:33) stable
|
Version 1.99.4 (2012-02-09 11:21:10) stable
|
||||||
|
|||||||
@@ -6914,6 +6914,8 @@ class Expression(object):
|
|||||||
return Query(self.db, op, self, value)
|
return Query(self.db, op, self, value)
|
||||||
|
|
||||||
def belongs(self, value):
|
def belongs(self, value):
|
||||||
|
if isinstance(value,Query):
|
||||||
|
value = self.db(value)._select(value.first._table._id)
|
||||||
return Query(self.db, self.db._adapter.BELONGS, self, value)
|
return Query(self.db, self.db._adapter.BELONGS, self, value)
|
||||||
|
|
||||||
def startswith(self, value):
|
def startswith(self, value):
|
||||||
|
|||||||
Reference in New Issue
Block a user