Opened 10 years ago

Last modified 2 months ago

#29 assigned Bug

Fix usability issue with limit_choices_to and "Add another" in admin

Reported by: adrian Owned by: anonymous
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: jamespic@… Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

django34: We have the ability to put a customized limit/filter on which related objects get displayed in select boxes. For instance, the "photographer" field on the "Add photo" form only displays the "Staff members" that have shoots_photos=True.

django34: This results in some usability problems, though, because if a producer doesn't see a person's name in the list, he might click "Add another..." instead of checking to make sure the person isn't in "Staff members" and doesn't have "shoots_photos" checked.

django34: Does this make sense?

wilson: kind of

wilson: what page would that case appear on

django34: Here's an example...

django34: The "Photographer" select box includes *only* the staff members that have shoots_photos=True.

django34: So if a producer doesn't see a photographer in there, he might click "Add another...", which would create an entirely new staff member. But it might be the case that the staff member DOES exist, just doesn't have shoots_photos=True checked.

wilson: if the staff member did exist, would it let them add them again?

django34: Yes, as long as the slug was different.

django34: The only way I can think of to fix this would be to have some sort of "Showing only photographers [Show all staff members]" link. Or to eliminate the filtering altogether.

wilson: i was going to suggest a "show all staff" link

wilson: yes, that is my suggestion

wilson: "show all staff" link next to the select

wilson: then "show photographers only" when the filter is off

django34: All right.

Change History (17)

comment:1 Changed 10 years ago by adrian

  • Owner changed from adrian to wilson

comment:2 Changed 9 years ago by Wilson

Let enough time go by and you will always disagree with yourself. I don't think my original suggestion is going to work here. "Show all staff" defeats the purpose of the limit in the first place.

The simplest solution is to just display a natural language description of the limit_choices requirements. But "Showing 53 staff members with takes photos set to true." isn't very user-friendly. Maybe this is just something that should be added to the help text for the field as a best practice?

Another problem is the fact that you can use "add another", create a new staff member that doesn't meet the limits and it won't show up. You could prefill the fields required to meet the limit in the add another popup (in this example, "takes photos" would be checked). That's not very transparent to the user, and it isn't clear that changing the prefilled fields will make your new object unavailable to the original relationship field.

comment:3 Changed 8 years ago by Gary Wilson <gary.wilson@…>

  • Triage Stage changed from Unreviewed to Design decision needed

This is an interesting problem.

comment:4 Changed 8 years ago by mtredinnick

  • Triage Stage changed from Ready for checkin to Design decision needed

Seems to have been a victim of the recent spam attack or something. Not "ready for checkin".

comment:5 Changed 7 years ago by jacob

  • Triage Stage changed from Design decision needed to Someday/Maybe
  • Version set to SVN

comment:6 Changed 7 years ago by mrts

  • milestone set to post-1.0

Non-essential for 1.0.

comment:7 Changed 6 years ago by anonymous

  • Cc jamespic@… added

comment:8 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:9 in reply to: ↑ description Changed 6 years ago by anonymous

  • Has patch set
  • Keywords runkps added
  • milestone set to 1.0.3
  • Needs documentation set
  • Needs tests set
  • Owner changed from nobody to anonymous
  • Patch needs improvement set
  • Status changed from new to assigned

Replying to adrian:

django34: We have the ability to put a customized limit/filter on which related objects get displayed in select boxes. For instance, the "photographer" field on the "Add photo" form only displays the "Staff members" that have shoots_photos=True.

django34: This results in some usability problems, though, because if a producer doesn't see a person's name in the list, he might click "Add another..." instead of checking to make sure the person isn't in "Staff members" and doesn't have "shoots_photos" checked.

django34: Does this make sense?

wilson: kind of

wilson: what page would that case appear on

django34: Here's an example...

django34: The "Photographer" select box includes *only* the staff members that have shoots_photos=True.

django34: So if a producer doesn't see a photographer in there, he might click "Add another...", which would create an entirely new staff member. But it might be the case that the staff member DOES exist, just doesn't have shoots_photos=True checked.

wilson: if the staff member did exist, would it let them add them again?

django34: Yes, as long as the slug was different.

django34: The only way I can think of to fix this would be to have some sort of "Showing only photographers [Show all staff members]" link. Or to eliminate the filtering altogether.

wilson: i was going to suggest a "show all staff" link

wilson: yes, that is my suggestion

wilson: "show all staff" link next to the select

wilson: then "show photographers only" when the filter is off

django34: All right.

comment:10 Changed 6 years ago by Alex

  • Has patch unset
  • Keywords runkps removed
  • milestone 1.0.3 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Reverted spam.

comment:11 Changed 4 years ago by subsume

If your requirements are so particular you can show all staff members in that drop-down and have form validation warn you when attempting to select one who isn't takes_photos=True. You could create a dropdown widget which the valid choices more obvious (some bold, some gray, etc).

...or maybe sit on the idea another 5 years =)

comment:12 Changed 4 years ago by lrekucki

  • Severity changed from minor to Normal
  • Type changed from defect to Bug

comment:13 Changed 4 years ago by julien

  • UI/UX set

comment:14 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:15 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:16 Changed 3 years ago by aaugustin

  • UI/UX set

Revert accidental batch modification.

comment:17 Changed 2 months ago by collinanderson

#23595 is prepopulating add fields based on limit_choices_to.

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