Mercurial > public > sg101
view custom_search/views.py @ 779:c740e097458f
Remove YouTube icon from social block.
This is because Google pretty much forced me to change the SG101
YouTube account to my personal account.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 04 May 2014 13:45:27 -0500 |
parents | 20a3bf7a6370 |
children | 840c1a8bd8af |
line wrap: on
line source
"""Custom views for searching.""" from haystack.views import SearchView class UserSearchView(SearchView): """This class passes the user making the search as an __init__ argument to the search form as the keyword argument 'user'. """ def build_form(self, form_kwargs=None): """Pass the request.user object to the form's constructor.""" if not form_kwargs: form_kwargs = {} if 'user' not in form_kwargs: form_kwargs['user'] = self.request.user return super(UserSearchView, self).build_form(form_kwargs)