Opened 11 years ago

Closed 13 months ago

#29 closed Bug (wontfix)

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

Reported by: Adrian Holovaty Owned by: nobody
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 11 years ago by Adrian Holovaty

Owner: changed from Adrian Holovaty to Wilson Miner

comment:2 Changed 11 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 10 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedDesign decision needed

This is an interesting problem.

comment:4 Changed 9 years ago by Malcolm Tredinnick

Triage Stage: Ready for checkinDesign decision needed

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

comment:5 Changed 9 years ago by Jacob

Triage Stage: Design decision neededSomeday/Maybe
Version: SVN

comment:6 Changed 8 years ago by mrts

milestone: post-1.0

Non-essential for 1.0.

comment:7 Changed 8 years ago by anonymous

Cc: jamespic@… added

comment:8 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:10 Changed 7 years ago by Alex Gaynor

Reverted spam.

comment:11 Changed 6 years ago by Yeago

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 6 years ago by Łukasz Rekucki

Severity: minorNormal
Type: defectBug

comment:13 Changed 6 years ago by Julien Phalip

UI/UX: set

comment:14 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:15 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:16 Changed 5 years ago by Aymeric Augustin

UI/UX: set

Revert accidental batch modification.

comment:17 Changed 2 years ago by Collin Anderson

#23595 is prepopulating add fields based on limit_choices_to.

comment:18 Changed 13 months ago by Karen Tracey

Resolution: wontfix
Status: newclosed

I agree with wilson of 10 years ago, the most likely helpful thing to do here, when this is a problem, is to include in the help text for the field some guidance to the user as to how this field is limited. As noted above #23595 also now exists to deal with "add another" properly respecting the limit_choices_to.

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