import os
import django

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
django.setup()

from core.models import Voter
from core.forms import VoterForm

voter = Voter.objects.first()
if voter:
    voter.phone_type = 'home'
    voter.save()
    form = VoterForm(instance=voter)
    print(f"Voter ID: {voter.id}, Phone Type: {voter.phone_type}")
    print(form['phone_type'].as_widget())
else:
    print("No voters found.")
