37769-vm/check_none.py
2026-05-30 08:01:02 +00:00

18 lines
613 B
Python

import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
django.setup()
from core.models import Voter, Tenant
def check_none():
print(f"Voters with NULL address_street: {Voter.objects.filter(address_street__isnull=True).count()}")
print(f"Voters with empty address_street: {Voter.objects.filter(address_street='').count()}")
print(f"Voters with NULL neighborhood: {Voter.objects.filter(neighborhood__isnull=True).count()}")
print(f"Voters with empty neighborhood: {Voter.objects.filter(neighborhood='').count()}")
if __name__ == "__main__":
check_none()