我通过覆盖“ list_row_actions”向列表视图添加了两个自定义的行操作按钮。这些按钮旨在在数据库中执行简单的SQL更新。是否可以在行操作/自定义按钮中使用“ column_editable_list”功能(如屏幕截图所示)?
{% extends 'admin/model/list.html' %}
{% block body %}
<h1>Custom AIX View</h1>
{{ super() }}
{% endblock %}
{% block list_row_actions %}
{{ super() }}
{# Trying to Add a Special Action #}
{# Icons you can use: http://getbootstrap.com/components/ #}
<form class="icon" method="POST" action="/node_status">
<button onclick="return confirm('Are you sure you want to run this?');" title="Change Node status">
<span class="fa fa-check glyphicon glyphicon-check"></span>
</button>
</form>
<form class="icon" method="POST" action="/wit_status">
<button onclick="return confirm('Are you sure you want to run this?');" title="Change Watchit status">
<span class="fa fa-eye-open glyphicon glyphicon-eye-open"></span>
</button>
</form>
{% endblock %}