SyntaxFix
Write A Post
Hire A Developer
Questions
As of Django 1.2, you can use exists():
exists()
https://docs.djangoproject.com/en/dev/ref/models/querysets/#exists
if some_queryset.filter(pk=entity_id).exists(): print("Entry contained in queryset")