Skip to content

Commit c9cd52c

Browse files
tomkinsacdha
authored andcommitted
Add load_all to the generic views form kwargs
The deprecated views in views.py automatially pass `load_all` to the search form. Class based generic views will now match this behaviour.
1 parent afba6a0 commit c9cd52c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

haystack/generic_views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def get_form_kwargs(self):
6262
kwargs.update({
6363
'data': self.request.GET,
6464
})
65-
kwargs.update({'searchqueryset': self.get_queryset()})
65+
kwargs.update({
66+
'searchqueryset': self.get_queryset(),
67+
'load_all': self.load_all,
68+
})
6669
return kwargs
6770

6871
def form_invalid(self, form):

test_haystack/test_generic_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def test_get_form_kwargs(self):
2828
self.assertEqual(form_kwargs.get('data').get('q'), self.query)
2929
self.assertEqual(form_kwargs.get('initial'), {})
3030
self.assertTrue('searchqueryset' in form_kwargs)
31+
self.assertTrue('load_all' in form_kwargs)
3132

3233
def test_search_view_response(self):
3334
"""Test the generic SearchView response."""

0 commit comments

Comments
 (0)