0
검색 양식을 만들려고하는데 작동하지 않습니다. 여기 내 코드는 다음과 같습니다클래스 기반보기를 사용하여 검색 양식이 작동하지 않습니다.
class LocationSearchMixin(object):
def get_queryset(self):
q = self.request.GET.get('q')
if q is None:
return queryset
class StoreListView(LocationSearchMixin, ListView):
model = Store
<form action="" method="GET">
<input type="text" name="q" />
<button type="submit">search</button>
</form>