Opened 7 years ago

Closed 7 years ago

#9068 closed (fixed)

InsertQuery.clone typo?

Reported by: rush Owned by: mtredinnick
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hello, I think there's a typo in django/db/models/sql/subqueries.py:296

return super(InsertQuery, self).clone(klass, extras)

instead of

return super(InsertQuery, self).clone(klass, **extras)

Please also consider this modification for better subclassing

    def clone(self, klass=None, **kwargs):
        extras = {'columns': self.columns[:], 'values': self.values[:],
                'params': self.params}
        extras.update(kwargs)
        return super(InsertQuery, self).clone(klass, **extras)

Change History (2)

comment:1 Changed 7 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to mtredinnick
  • Patch needs improvement unset
  • Status changed from new to assigned

In future, please attach a patch, rather than putting it in the description so that we can make sure the right change is applied. Actually that whole clone() method looks pretty broken. I'll have to fix it and write some tests, etc.

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in r9150 (and r9151 on the django-1.0.X branch).

Note: See TracTickets for help on using tickets.
Back to Top