結果が list 内の 1 つのオブジェクトを除外するようにクエリをフィルター処理するにはどうすればよいですか? id=1 モデル = AutoShow の場合
見る:
class autoshow_index(ListView):
context_object_name = "numcar"
model = AutoShow
def get_context_data(self, **kwargs):
context = super(autoshow_index, self).get_context_data(**kwargs)
context['bnrlarg'] = BannerLarge.objects.all()[:1]
return context
テンプレート :
{% for autoshow in object_list %}
<h2><a href="/autoshow_page/{{autoshow.slug}}"> {{ autoshow.title }}</a></h2>
{% endfor %}