Created
February 12, 2023 15:50
-
-
Save pimiento/3d965fa9c648283765c801a9a640bbf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filter_is_favorited(self, queryset, name, value): | |
if value and not self.request.user.is_anonymous: | |
return queryset.filter(favorites__user=self.request.user) | |
return queryset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment