whitebear
whitebear

Reputation: 12445

Hiding the one certain row of tables in admin

I want to hiding the one certain row of tables in admin.

I have these tables.

id name
1  main // hide this row in admin.
2  John
3  Lisa

At first, I try to override template change_list_result.html and edit here, but still no success.

<tr class="{% cycle 'row1' 'row2' %}">
{% for item in result %}
{{ item }}{% endfor %}
</tr>

Is there any good way or my plan is basically ok?

Upvotes: 0

Views: 182

Answers (1)

Timoth&#233; Delion
Timoth&#233; Delion

Reputation: 1460

Your answer is probably here : overriding the admin class get_queryset() method.

def get_queryset(self, request): 
   qs = super(IssueAdmin, self).get_queryset(request) 
   return qs.filter(myparam=False)

Upvotes: 1

Related Questions