0
変数を渡す方法done()
〜SearchAdvertResultView(ListView)
から変数を渡す方法(min_amountとmax_amount)ListViewにパラメータを渡す方法は?
def done(self)
...
min_amount = 100
max_amount = 500
return redirect(reverse('board:search-result'))
urls.py:
...
url(r'^results$',
SearchAdvertResultView.as_view(),
name='search-result',
),
...
views.py:
...
class SearchAdvertResultView(ListView):
template_name = "board/search_results.html"
def get_queryset(self):
...
return Adverts.objects.filter(amount__range=(min_amount, max_amount))
...
0123いくつかのオブジェクトの
完了()メソッド