~ubuntu-branches/debian/squeeze/python-django/squeeze

« back to all changes in this revision

Viewing changes to django/db/models/query.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb, Chris Lamb, David Spreen, Sandro Tosi
  • Date: 2008-11-19 21:31:00 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081119213100-gp0lqhxl1qxa6dgl
Tags: 1.0.2-1
[ Chris Lamb ]
* New upstream bugfix release. Closes: #505783
* Add myself to Uploaders with ACK from Brett.

[ David Spreen ]
* Remove python-pysqlite2 from Recommends because Python 2.5 includes
  sqlite library used by Django. Closes: 497886

[ Sandro Tosi ]
* debian/control
  - switch Vcs-Browser field to viewsvn

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
CHUNK_SIZE = 100
16
16
ITER_CHUNK_SIZE = CHUNK_SIZE
17
17
 
 
18
# The maximum number of items to display in a QuerySet.__repr__
 
19
REPR_OUTPUT_SIZE = 20
 
20
 
18
21
# Pull into this namespace for backwards compatibility.
19
22
EmptyResultSet = sql.EmptyResultSet
20
23
 
141
144
        return obj_dict
142
145
 
143
146
    def __repr__(self):
144
 
        return repr(list(self))
 
147
        data = list(self[:REPR_OUTPUT_SIZE + 1])
 
148
        if len(data) > REPR_OUTPUT_SIZE:
 
149
            data[-1] = "...(remaining elements truncated)..."
 
150
        return repr(data)
145
151
 
146
152
    def __len__(self):
147
153
        # Since __len__ is called quite frequently (for example, as part of