Opened 5 years ago

Last modified 3 years ago

#24561 assigned New feature

Allow model field choices to accept callables.

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

comment:1 Changed 5 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 5 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 3 years ago by felixxm

Has patch: unset
Patch needs improvement: unset

See also discussion in #28033.

comment:4 Changed 3 years ago by Sergey Fedoseev

Cc: Sergey Fedoseev added

comment:5 Changed 3 years ago by Sergey Fedoseev

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top