开发者

Pass logged in user to haystack search

I want to show my search results in respect to account type of the current logged in user. Is it possible to pass user from request to object in urls? If not, how else can I pass it?

To be more specific. In haystack urls.py we have

url(r'^$', SearchView(), name='haystack_开发者_如何学Pythonsearch'),

Can I somehow to SearchView object pass current logged in user?


I didn`t notice that SearchViews has access to request so it is really easy to get user in this class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜