python django how can i filter object_set.all by current user in template -


I have tried to explain the issues above, given by the current user

thanks for

One way to do this in the template is to define a custom filter, to query a query and the currently logged in user as a logic Can make doors and may require filtering.

  @ register.filter def filter_by_user (queryset, user): query by "" "(currently logged in) user return filter queryset.filter (added = user =) < / Code> 

and in the template:

  & lt; td & gt; {{book.rating_set.all | filter_buy: user: cefacec | join: "," }}   

Comments