Answer the question
In order to leave comments, you need to log in
How to make all values in Django admin selected by default?
There is a Django admin panel. In it, you need to select the objects to export in the list view.
By default, no objects are selected. I need to click on the checkbox in the header to select all records on the current page, then scroll down and click on the "Select all xxx records" link, which looks like this:
<span class="question" style="display: inline;">
<a href="javascript:;" title="Нажмите здесь, чтобы выбрать объекты на всех страницах">
Select all xxx записей</a>
</span>
Answer the question
In order to leave comments, you need to log in
In general, so far I have implemented such a crutch:
In the appropriate admin template, added added to the initialization of another script:
<script type="text/javascript">
(function ($) {
$(document).ready(function ($) {
$(django.jQuery.fn.actions.defaults.allToggle)[0].click();
$(django.jQuery.fn.actions.defaults.acrossQuestions + " a")[0].click();
});
})(django.jQuery);
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question