Opened 3 years ago

Closed 3 years ago

#18573 closed New feature (needsinfo)

formfield_callback attribute on ModelForm not being passed to modelform_factory

Reported by: django@… Owned by: nobody
Component: Forms Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Solitary ModelForm instances are run though ModelForm.formfield_callback() when they are instantiated. It would be nice if ModelForm instances generated from modelform_factory also did this without having to specify formfield_callback again when calling modelform_factory.

In effect:

    modelform_factory(
        model=AModel,
        form=AModelForm,
        formfield_callback=AModelForm.formfield_callback if hasattr(AModelForm, 'formfield_callback') else None
        )

I am not entirely sure of the terminology. I'm happy to explain further if need be.

Attachments (1)

0001-test-default-formfield_callback.patch (1.7 KB) - added by tuxcanfly 3 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 3 years ago by lrekucki

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 3 years ago by tuxcanfly

comment:2 Changed 3 years ago by tuxcanfly

This works as expected on trunk, if I'm not missing anything. Added test.

comment:3 Changed 3 years ago by claudep

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

The test also passes on 1.3 and 1.4 branches. Paul, I think it's now your turn to show us the real issue, in the case we misunderstood it.

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