我想在管理员中隐藏表的某一行。
我有这些表。
id name
1 main // hide this row in admin.
2 John
3 Lisa
起初,我尝试覆盖模板change_list_result.html
并在此处进行编辑,但仍然没有成功。
<tr class="{% cycle 'row1' 'row2' %}">
{% for item in result %}
{{ item }}{% endfor %}
</tr>
有什么好办法吗,或者我的计划基本上可以吗?
您的答案可能是here:覆盖管理类get_queryset()
方法。