Good day,
I can not understand how to put action on the button in Django admin
Override change_list.html for models:
{% extends "admin/change_list.html" %}
{% load i18n admin_urls %}
{% block object-tools %}
{% if has_add_permission %}
<ul class="object-tools">
{% block object-tools-items %}
the <li>
<button type="submit" name="getShard" value="getShard" class="button">Get Shard</button>
</li>
the <li>
<button type="submit" name="refreshShard" value="refreshShard" class="button">Refresh the Shard</button>
</li>
{% endblock %}
</ul>
{% endif %}
{% endblock %}
Wrote in admin.py conditional functions:
def getShard():
pass
def refreshShard():
pass
Please tell me how to associate functions with the buttons? Or where can I see the material on the topic?