Opened 7 years ago

Last modified 7 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: dev
Severity: Normal Keywords:
Cc: Sergey Fedoseev 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 (4)

comment:1 Changed 7 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 7 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 years ago by Mariusz Felisiak

Has patch: unset
Patch needs improvement: unset

See also discussion in #28033.

comment:4 Changed 5 years ago by Sergey Fedoseev

Cc: Sergey Fedoseev added
Note: See TracTickets for help on using tickets.
Back to Top