{"repo":"michalpokusa/django-no-queryset-admin-actions","free":true,"listed":false,"github":"https://github.com/michalpokusa/django-no-queryset-admin-actions","clone":"git clone https://github.com/michalpokusa/django-no-queryset-admin-actions.git","description":"Extension for the Django admin panel that makes it possible to add actions that do not require a queryset to run.","language":"Python","stars":17,"topics":[],"license":"MIT","category":"dashboards-admin","readme_excerpt":"django-no-queryset-admin-actions Extension for the Django admin panel that makes it possible to add actions that do not require a queryset to run. Works with django-admin-action-forms. - 🔌 Installation - ✏️ Examples - No queryset actions - Optional queryset actions 🔌 Installation 1. Install using pip : 2. Add 'django no queryset admin actions' to your INSTALLED APPS setting. ✏️ Examples No queryset actions Let's say you have an action that fetches external orders from an API. You don't need a queryset to run this action, but Django requires it by default. By using the @no queryset action , you can bypass that, and create actions that can be run without selecting any objects. Optional queryset actions Another use case is when you have an action that can be run on a specific queryset, but you also want to allow running it without selecting any objects. This type of action could be used to e.g.: - default to all, or a filtered subset of objects when no selection is made - choose a random object if no specific item is selected Leveraging the @optional queryset action decorator, you can create actions that run whether or not objects are selected. Let's say, that ExternalOrder objects fetched in the previous example may sometimes need updating. In this example, if no objects are selected, queryset will be empty, and the action will default to updating all ExternalOrder objects.","default_branch":null,"files":null,"tree":[],"storefront":"/r/michalpokusa","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/michalpokusa/django-no-queryset-admin-actions/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}