#1358 closed defect (fixed)
Python 2.3 incompatibility in magic-removal
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Metasystem | Version: | magic-removal |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Python 2.3 doesn't have generator expressions, so we need to use list comprehension instead:
Index: django/db/models/query.py =================================================================== --- django/db/models/query.py (revision 2307) +++ django/db/models/query.py (working copy) @@ -790,7 +790,7 @@ cursor.execute("DELETE FROM %s WHERE %s IN (%s)" % \ (backend.quote_name(related.field.get_m2m_db_table(related.opts)), backend.quote_name(cls._meta.object_name.lower() + '_id'), - ','.join('%s' for pk in pk_list)), + ','.join(['%s' for pk in pk_list])), pk_list) for f in cls._meta.many_to_many: cursor.execute("DELETE FROM %s WHERE %s IN (%s)" % \
Note:
See TracTickets
for help on using tickets.
(In [2308]) magic-removal: Fixed #1358 -- Fixed Python 2.3 incompatibility in django.db.models.query. Thanks, Christopher Lenz