Opened 8 years ago

Closed 8 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:
Needs tests: Patch needs improvement:
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@… 8 years ago.
patch for newforms/models.py
models.2.diff (1.3 KB) - added by guido@… 8 years ago.
Fixes typo in previous patch

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by guido@…

patch for newforms/models.py

Changed 8 years ago by guido@…

Fixes typo in previous patch

comment:1 Changed 8 years ago by mtredinnick

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

(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