Sprawdź ten identyfikator istnieje w bazie danych Django

Votes.objects.filter(user_id=user_id, post_id=post_id).exists()
Mysterious Mosquito