MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / get_form_kwargs

Method get_form_kwargs

haystack/generic_views.py:57–67  ·  view source on GitHub ↗

Returns the keyword arguments for instantiating the form.

(self)

Source from the content-addressed store, hash-verified

55 return self.queryset
56
57 def get_form_kwargs(self):
58 """
59 Returns the keyword arguments for instantiating the form.
60 """
61 kwargs = {"initial": self.get_initial()}
62 if self.request.method in ["HEAD", "GET"]:
63 kwargs.update({"data": self.request.GET})
64 kwargs.update(
65 {"searchqueryset": self.get_queryset(), "load_all": self.load_all}
66 )
67 return kwargs
68
69 def form_invalid(self, form):
70 context = self.get_context_data(

Callers 2

get_form_kwargsMethod · 0.45
test_get_form_kwargsMethod · 0.45

Calls 2

get_querysetMethod · 0.95
updateMethod · 0.45

Tested by 1

test_get_form_kwargsMethod · 0.36