Opened 16 years ago

Closed 16 years ago

#9068 closed (fixed)

InsertQuery.clone typo?

Reported by: rush Owned by: Malcolm Tredinnick
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: no UI/UX: no

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 by Malcolm Tredinnick, 16 years ago

Owner: changed from nobody to Malcolm Tredinnick
Status: newassigned

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 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: assignedclosed

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

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