mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #27546 -- Removed hardcoded class names in __repr__() methods.
This commit is contained in:
parent
794b7d8033
commit
48826aa541
6 changed files with 14 additions and 8 deletions
|
@ -225,7 +225,7 @@ class QuerySet(object):
|
|||
data = list(self[:REPR_OUTPUT_SIZE + 1])
|
||||
if len(data) > REPR_OUTPUT_SIZE:
|
||||
data[-1] = "...(remaining elements truncated)..."
|
||||
return '<QuerySet %r>' % data
|
||||
return '<%s %r>' % (self.__class__.__name__, data)
|
||||
|
||||
def __len__(self):
|
||||
self._fetch_all()
|
||||
|
@ -1220,7 +1220,7 @@ class RawQuerySet(object):
|
|||
self.query.cursor.close()
|
||||
|
||||
def __repr__(self):
|
||||
return "<RawQuerySet: %s>" % self.query
|
||||
return "<%s: %s>" % (self.__class__.__name__, self.query)
|
||||
|
||||
def __getitem__(self, k):
|
||||
return list(self)[k]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue