Opened 12 years ago

Closed 12 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 12 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Łukasz Rekucki, 12 years ago

Triage Stage: UnreviewedAccepted

comment:2 by tuxcanfly, 12 years ago

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

comment:3 by Claude Paroz, 12 years ago

Resolution: needsinfo
Status: newclosed

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