Django

Code

Ticket #13075 (new)

Opened 5 months ago

Last modified 5 months ago

BaseForm __init__ doesn't super and so breaks MI Mixins

Reported by: gbauer Assigned to: nobody
Milestone: Component: Forms
Version: 1.1 Keywords: mixins
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

BaseForm?'s init method doesn't do a super(...) call to follow up the chain, which breaks writing mixins for ModelForms?, as the chain is not followed to the classes to the right of the base classes:

class MyForm?(ModelForm?, ModelFormMixin?):

... do stuff

Inheritance will follow ModelForm? up the chain until it hits BaseForm? and then stop following up further, but ModelFormMixin? is in the mro after the mro of ModelForm? and so will never looked at. Just adding a super(BaseForm?, self).init(.....) to the BaseForm? init will work wonders there ...

Attachments

Change History

03/10/10 19:31:52 changed by russellm

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

Add/Change #13075 (BaseForm __init__ doesn't super and so breaks MI Mixins)




Change Properties
Action