mirror of
https://github.com/django/django.git
synced 2025-07-04 01:39:20 +00:00
boulder-oracle-sprint: Fixed #3835 by making CursorDebugWrapper
iterable, as it should have been. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4840 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c4eb6bf708
commit
05189a61e9
@ -33,6 +33,9 @@ class CursorDebugWrapper(object):
|
||||
'time': "%.3f" % (stop - start),
|
||||
})
|
||||
|
||||
def __iter__(self):
|
||||
return self.cursor.__iter__()
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if self.__dict__.has_key(attr):
|
||||
return self.__dict__[attr]
|
||||
@ -98,9 +101,9 @@ def truncate_name(name, length=None):
|
||||
"""
|
||||
if length is None or len(name) <= length:
|
||||
return name
|
||||
|
||||
|
||||
hash = md5.md5(name).hexdigest()[:4]
|
||||
|
||||
|
||||
return '%s%s' % (name[:length-4], hash)
|
||||
|
||||
##################################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user