diff --git a/gluon/dal.py b/gluon/dal.py index f2592868..ed9f4d5e 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -8386,10 +8386,7 @@ class Table(object): elif isinstance(key, dict): """ for keyed table """ query = self._build_query(key) - rows = self._db(query).select() - if rows: - return rows[0] - return None + return self._db(query).select(limitby=(0,1), orderby_on_limitby=False).first() elif str(key).isdigit() or 'google' in DRIVERS and isinstance(key, Key): return self._db(self._id == key).select(limitby=(0,1), orderby_on_limitby=False).first() elif key: