orderby disabled where not needed
This commit is contained in:
+1
-1
@@ -9833,7 +9833,7 @@ class Set(object):
|
||||
return built
|
||||
|
||||
def isempty(self):
|
||||
return not self.select(limitby=(0,1))
|
||||
return not self.select(limitby=(0,1), orderby_on_limitby=False)
|
||||
|
||||
def count(self,distinct=None, cache=None):
|
||||
db = self.db
|
||||
|
||||
@@ -236,9 +236,12 @@ class TestInsert(unittest.TestCase):
|
||||
self.assertEqual(db.tt.insert(aa='1'), 2)
|
||||
self.assertEqual(db.tt.insert(aa='1'), 3)
|
||||
self.assertEqual(db(db.tt.aa == '1').count(), 3)
|
||||
self.assertEqual(db(db.tt.aa == '2').isempty(), True)
|
||||
self.assertEqual(db(db.tt.aa == '1').update(aa='2'), 3)
|
||||
self.assertEqual(db(db.tt.aa == '2').count(), 3)
|
||||
self.assertEqual(db(db.tt.aa == '2').isempty(), False)
|
||||
self.assertEqual(db(db.tt.aa == '2').delete(), 3)
|
||||
self.assertEqual(db(db.tt.aa == '2').isempty(), True)
|
||||
db.tt.drop()
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -648,11 +648,11 @@ class IS_NOT_IN_DB(Validator):
|
||||
id = self.record_id
|
||||
if isinstance(id, dict):
|
||||
fields = [table[f] for f in id]
|
||||
row = subset.select(*fields, **dict(limitby=(0, 1))).first()
|
||||
row = subset.select(*fields, **dict(limitby=(0, 1), orderby_on_limitby=False)).first()
|
||||
if row and any(str(row[f]) != str(id[f]) for f in id):
|
||||
return (value, translate(self.error_message))
|
||||
else:
|
||||
row = subset.select(table._id, field, limitby=(0, 1)).first()
|
||||
row = subset.select(table._id, field, limitby=(0, 1), orderby_on_limitby=False).first()
|
||||
if row and str(row.id) != str(id):
|
||||
return (value, translate(self.error_message))
|
||||
return (value, None)
|
||||
|
||||
Reference in New Issue
Block a user