Opened 2 years ago

Last modified 5 months ago

#24561 new New feature

Allow model field choices to accept callables.

Reported by: Christopher Grebs Owned by: nobody
Component: Database layer (models, ORM) Version: master
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


Django 1.8 introduced the ability to pass a callable for 'choices' but it seems the check-framework was not adapted to this.

Pull Request:

Change History (3)

comment:1 Changed 2 years ago by Tim Graham

Component: Core (System checks)Database layer (models, ORM)
Patch needs improvement: set
Summary: Allow 'choices'-check to work for callables.Allow model field choices to accept callables.
Triage Stage: UnreviewedAccepted
Type: BugNew feature
Version: 1.8master

It was added for django.forms.ChoiceField, but not model field choices. It might be a reasonable feature request, but it needs to be implemented. It might cause some difficulty in migrations, but I will accept the ticket if someone wants to investigate the possibility.

comment:2 Changed 2 years ago by Christopher Grebs

Oh, then I misread the feature. I'll try to update the patch to port this to the model field choices as well.

comment:3 Changed 5 months ago by felixxm

Has patch: unset
Patch needs improvement: unset

See also discussion in #28033.

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