#10768: Allow for Admin Actions to be applied to an empty QuerySet
-------------------------------------+-------------------------------------
     Reporter:  andrepleblanc@…      |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  contrib.admin        |                  Version:  dev
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  actions              |             Triage Stage:  Design
                                     |  decision needed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by hcharp):

 Replying to [comment:8 Humberto Yances]:
 > Replying to [comment:6 Karen Tracey]:
 > > Performing an action on an empty query set should do nothing.
 Therefore there is no point in calling the action with an empty query set.
 (If the action did something other than nothing, that would be surprising;
 enabling such surprises in the admin UI seems like a Bad Idea.)  #12281
 covers the case of issuing a message that something needs to be selecting
 before you can successfully perform an action.  We should fix #12281 and
 reject this one.
 >
 >
 > == Actions that don't act on specific items are a fundamentally
 different
 >
 > I would not state this in such an absolute way, and preclude users the
 option to make their own wrong choices…
 >
 > Limited to django, I'm not particularly experienced, I seldom contribute
 to django programs. Now in the current assignment we need to import data
 from external sources (openstreetmap, wubook), and we either need to
 refresh a subset of our already existing items, or we want to import
 things from scratch. The code in the two cases is obviously the same. The
 "import from scratch" we run on an empty selection, and our initial
 workaround was really terrible, that is remove everything, add a fake new
 object, select it, then run the action.
 >
 > I'm looking into the object-tools, and I have several perplexities: one
 is that it looks quite a bit more work to add them; two is that I need to
 program my actions elsewhere, while they do fundamentally the same thing;
 three is that the action I need depends on the table I'm in, it's
 definitely not a generic tool.
 >
 > so while we can't activate the action on an empty selection, I'm afraid
 I'm going to register the same action twice, where one will just invoke
 the other with an empty selection, simply by-passing this django check


 I have the EXACT same issue ; it can seem to be a bad UI practice, but we
 can have needs that you have not thought about yet. And I agree with the
 freedom of customization.
 Plus, both the doc and community about how to add a button that would do
 that are not as clear as the doc for Custom Actions.

 For beginners, it could allow to get a MVP, something that could be a bad
 UI practice for you, but at least, something that works.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10768#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070182ee34387f-b6231d49-e7ab-48bb-9a8c-740c61af933a-000000%40eu-central-1.amazonses.com.

Reply via email to