Opened 9 years ago

Closed 9 years ago

#6197 closed (fixed)

Please add formfield_callback arg to newforms.models.ModelFormMetaclass.__new__().

Reported by: guido@… Owned by: nobody
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I've run into a use case where I want to subclass the metaclass in order to provide a different way to map models to form fields. Right now I have to copy all of ModelFormMetaclass.new() in order to override the formfield_callback argument in the call to fields_for_model() in new().

I'll attach a patch too.

Attachments (2)

models.diff (1.3 KB) - added by guido@… 9 years ago.
patch for newforms/models.py
models.2.diff (1.3 KB) - added by guido@… 9 years ago.
Fixes typo in previous patch

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by guido@…

Attachment: models.diff added

patch for newforms/models.py

Changed 9 years ago by guido@…

Attachment: models.2.diff added

Fixes typo in previous patch

comment:1 Changed 9 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [6940]) Fixed #6197 -- Added (optional) formfield_callback argument to ModelForms.new. Patch from guido@….

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