Django

Code

Ticket #7617 (closed: fixed)

Opened 5 months ago

Last modified 5 months ago

ModelFormMetaclass.__new__ is incompatible with metaclass mixins

Reported by: Christian Tanzer <tanzer@swing.co.at> Assigned to: nobody
Milestone: Component: Forms
Version: newforms-admin Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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, ModelFormMetaclass?.new doesn't use super(...).new in all cases.

I'll attach a patch fixing this.

Attachments

models.diff (1.7 kB) - added by Christian Tanzer <tanzer@swing.co.at> on 07/03/08 03:44:28.
patch for newforms/models.py

Change History

07/03/08 03:44:28 changed by Christian Tanzer <tanzer@swing.co.at>

  • attachment models.diff added.

patch for newforms/models.py

07/06/08 07:29:43 changed 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.

07/06/08 07:40:15 changed by mtredinnick

  • needs_better_patch changed.
  • needs_tests changed.
  • version changed from SVN to newforms-admin.
  • needs_docs changed.
  • has_patch set to 1.
  • stage changed from Unreviewed to Accepted.

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.

07/06/08 10:28:05 changed by brosner

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #7617 (ModelFormMetaclass.__new__ is incompatible with metaclass mixins)




Change Properties
Action