[SQL-CVS] r2994 - in SQLObject/trunk/sqlobject: . tests
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2007-09-26 17:43:52
|
Author: phd Date: 2007-09-26 11:43:47 -0600 (Wed, 26 Sep 2007) New Revision: 2994 Modified: SQLObject/trunk/sqlobject/sresults.py SQLObject/trunk/sqlobject/tests/test_select.py Log: Removed SelectResults.__nonzero__, which was a design mistake. See the thread http://mail.python.org/pipermail/python-dev/2007-September/074731.html Modified: SQLObject/trunk/sqlobject/sresults.py =================================================================== --- SQLObject/trunk/sqlobject/sresults.py 2007-09-26 17:43:00 UTC (rev 2993) +++ SQLObject/trunk/sqlobject/sresults.py 2007-09-26 17:43:47 UTC (rev 2994) @@ -57,10 +57,6 @@ def __repr__(self): return "<%s at %x>" % (self.__class__.__name__, id(self)) - def __nonzero__(self): - raise NotImplementedError( - "To test if a SelectResult will produce any items, use list(result) or result.count()") - def _getConnection(self): return self.ops.get('connection') or self.sourceClass._connection Modified: SQLObject/trunk/sqlobject/tests/test_select.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_select.py 2007-09-26 17:43:00 UTC (rev 2993) +++ SQLObject/trunk/sqlobject/tests/test_select.py 2007-09-26 17:43:47 UTC (rev 2994) @@ -166,8 +166,3 @@ assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlb.*$")).count() == 1 assert IterTest.select(RLIKE(IterTest.q.name, "^sqlx.*$")).count() == 0 - -def test_bool_SelectResults(): - setupClass(IterTest) - - raises(NotImplementedError, bool, IterTest.select()) |