diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-13 20:35:41 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-13 20:35:41 +0000 |
| commit | ac934fc5330fad7ba971478d3d21fc5535fc848a (patch) | |
| tree | 0c91ae4ece2c02dd7d1d74622e88edabd512fdfa /lib/sqlalchemy/orm | |
| parent | 17684a1b81b63a436fcf4f8426bcd822bdb8d463 (diff) | |
| download | sqlalchemy-ac934fc5330fad7ba971478d3d21fc5535fc848a.tar.gz | |
- renamed query.slice_() to query.slice()
- pulled out DeclarativeMeta.__init__ into its own function, added instrument_declarative()
which will do the "declarative" thing to any class independent of its lineage (for ctheune)
- added "cls" kwarg to declarative_base() allowing user-defined base class for declarative base [ticket:1042]
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index b7d6199b8..608f3f734 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -956,7 +956,7 @@ class Query(object): if start < 0 or stop < 0: return list(self)[item] else: - res = self.slice_(start, stop) + res = self.slice(start, stop) if step is not None: return list(res)[None:None:item.step] else: @@ -964,7 +964,7 @@ class Query(object): else: return list(self[item:item+1])[0] - def slice_(self, start, stop): + def slice(self, start, stop): """apply LIMIT/OFFSET to the ``Query`` based on a range and return the newly resulting ``Query``.""" if start is not None and stop is not None: @@ -974,7 +974,7 @@ class Query(object): self._limit = stop elif start is not None and stop is None: self._offset = (self._offset or 0) + start - slice_ = _generative(__no_statement_condition)(slice_) + slice = _generative(__no_statement_condition)(slice) def limit(self, limit): """Apply a ``LIMIT`` to the query and return the newly resulting |
