#10320: CursorDebugWrapper should allow using iterators/generators for
executemany().
---------------------------------------------------+------------------------
Reporter: MockSoul | Owner: nobody
Status: new | Milestone: post-1.0
Component: Database layer (models, ORM) | Version: 1.0
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by MockSoul):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Easiest fixup:
{{{
#!patch
=== modified file 'django/db/backends/util.py'
--- django/db/backends/util.py 2008-11-12 00:35:24 +0000
+++ django/db/backends/util.py 2009-02-21 13:57:42 +0000
@@ -32,7 +32,7 @@
finally:
stop = time()
self.db.queries.append({
- 'sql': '%s times: %s' % (len(param_list), sql),
+ 'sql': '%s times: %s' % (len(param_list) if
hasattr(param_list, '__len__') else '??', sql),
'time': "%.3f" % (stop - start),
})
}}}
Because param_list may be iterator and already iterated iterator (hmm =))
-- there is no way to determine it's length after underlying executemany()
cursor call. Thus, -- '??' is okay, imho :).
--
Ticket URL: <http://code.djangoproject.com/ticket/10320#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---