Opened 12 years ago
Closed 12 years ago
#21860 closed Cleanup/optimization (fixed)
ModelChoiceField documentation doesn't include the `to_field_name` optional argument
| Reported by: | Owned by: | ANUBHAV JOSHI | |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | anubhav9042@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The current ModelChoiceField arguments documentation doesn't cover the to_field_name attribute for overriding which value is used by prepare_value and to_python methods in lieu of the pk.
Given the argument is technically part of the available public API, it should probably be documented.
Change History (6)
comment:1 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 12 years ago
| Cc: | added |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:3 by , 12 years ago
| Has patch: | set |
|---|
comment:4 by , 12 years ago
Keryn, the PR linked above looks ok to me, but I was wondering if there was a specific use case that you came across for this that we might be able to use to improve the patch?
comment:5 by , 12 years ago
The specific use-case wasn't mine, it was someone in IRC's. The rationale for needing to do that wasn't (and isn't) clear to me, but evidently at least two people wanted it (whoever wrote the implementation, and the IRC user trying to do the same). I've previously commented on the PR, and assuming Anubhav can make the changes you've since noted on it, am happy with it.
comment:6 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
https://github.com/django/django/pull/2399