Opened 8 years ago

Closed 8 years ago

#7617 closed (fixed)

ModelFormMetaclass.__new__ is incompatible with metaclass mixins

Reported by: Christian Tanzer <tanzer@…> Owned by: nobody
Component: Forms Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I wanted to define a subclass of ModelFormMetaclass that also inherits from a mixin. Because new has an additional parameter formfield_callback, the call of the mixin's new fails.
In addition, doesn't use super(...).new in all cases.

I'll attach a patch fixing this.

Attachments (1)

models.diff (1.7 KB) - added by Christian Tanzer <tanzer@…> 8 years ago.
patch for newforms/

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Christian Tanzer <tanzer@…>

patch for newforms/

comment:1 Changed 8 years ago by mtredinnick

(In [7847]) Changed ModelFormMetaclass to have the normal signature for a new method.
Allows extending the metaclass more normally.

Patch from Christian Tanzer. Refs #7617.

comment:2 Changed 8 years ago by mtredinnick

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from SVN to newforms-admin

Most of this patch was for trunk (and that went into [7847]), but there's a portion just at the end that patches from formclass stuff. That is newforms-admin territory, so moving to that branch for them to handle (and close when it's done). Basically, the call to ModelFormMetaclass.__new__() has to change slightly.

comment:3 Changed 8 years ago by brosner

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

(In [7854]) newforms-admin: Fixed #7617 -- Adjusted the call to in modelform_factory to work with the new signature introduced in [7847].

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