Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18637 closed Bug (fixed)

FK.limit_choices_to doc says it's for admin, but works in ModelForm

Reported by: Tuttle Owned by: stumbles
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: stumbles Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Using limit_choices_to option on a ForeignKey field works for me in the ModelForm too.

I didn't test M2M field's limit_choices_to.

Therefore to me, the doc appears to be a bit misleading mentioning "admin" twice.

Attachments (1)

trac#18637.diff (13.9 KB) - added by stumbles 3 years ago.
Replace usage of 'admin' as a synonym for ModelForms.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by claudep

It appears that on that page, there are multiple references to admin as a synonym for ModelForm.

For example, "The admin represents this as an <input type="text">". Shouldn't this read as "The default form widget for this field is a TextInput."?

Changed 3 years ago by stumbles

Replace usage of 'admin' as a synonym for ModelForms.

comment:3 Changed 3 years ago by stumbles

  • Cc stumbles added
  • Has patch set

I've updated several places where "admin" is used as a synonym for automatically generated forms.

I was hoping that using :class:~django.forms.widgets.TextInput would give a hyperlink to the widget documentation, but it doesn't seem to. Happy to fix this if there's a better way.

comment:4 Changed 3 years ago by stumbles

  • Owner changed from nobody to stumbles
  • Status changed from new to assigned

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In [13d47c3f338e1e9a5da943b97b5334c0523d2e2c]:

Fixed #18637 - Updated some documentation for aspects of models that are ModelForm specific, not admin specific.

Thanks Ben Sturmfels for the patch.

comment:6 Changed 3 years ago by Tim Graham <timograham@…>

In [27c2ccc1ea0d08752a480aae30d48be6126d21ff]:

[1.4.x] Fixed #18637 - Updated some documentation for aspects of models that are ModelForm specific, not admin specific.

Thanks Ben Sturmfels for the patch.

Backport of 13d47c3f338e1e9a5da943b97b5334c0523d2e2c from master.

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