New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #2445: Allow callable values for limit_choices_to. #1228

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@zyegfryed
Contributor

zyegfryed commented May 27, 2013

Introduces the Model.choices_for_FOO method allowing to extend the limit_choices_to option.

@charettes

View changes

Show outdated Hide outdated docs/ref/models/instances.txt Outdated
@mjtamlyn

View changes

Show outdated Hide outdated docs/ref/models/instances.txt Outdated
@bmispelon

View changes

Show outdated Hide outdated django/db/models/fields/__init__.py Outdated
@timgraham

View changes

Show outdated Hide outdated docs/ref/models/instances.txt Outdated
@timgraham

This comment has been minimized.

Show comment
Hide comment
@timgraham

timgraham Jun 4, 2013

Member

This also needs to be added to the release notes both as a minor feature and as a backwards incompatible change (for the rare chance that someone has a choices_for_FOO method already defined on his models).

Member

timgraham commented Jun 4, 2013

This also needs to be added to the release notes both as a minor feature and as a backwards incompatible change (for the rare chance that someone has a choices_for_FOO method already defined on his models).

zyegfryed
Fixed #2445: Allow callable values for limit_choices_to.
Introduces the Model.choices_for_FOO method allowing to extend the limit_choices_to option.
Fixed legacy code to use the decorator syntax for property.
Added release notes and backward compatibility documentation.
Thanks @charettes, @evildmp, @mjtamlyn, @bmispelon and @timgraham for feedback.
@timgraham

This comment has been minimized.

Show comment
Hide comment
@timgraham

timgraham Jun 6, 2013

Member

Per comment on the ticket, this approach has been rejected in favor of passing choices a callable.

Member

timgraham commented Jun 6, 2013

Per comment on the ticket, this approach has been rejected in favor of passing choices a callable.

@timgraham timgraham closed this Jun 6, 2013

@zyegfryed zyegfryed deleted the zyegfryed:ticket_2445 branch Jun 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment