# Path: elections/settings.py
# DEFAULT_SETTINGS = {
#     'TEST_DATA_ONLY': False,
#     'FTP_USER': 'anonymous',
#     'FTP_PASSWORD': '',
#     'FTP_HOST': '',
#     'DOWNLOAD_PATHS': [],
#     'DEST_PATH': '/tmp/election/',
#     'IMAGE_MODEL': None,
#     'IMAGE_STORAGE': settings.DEFAULT_FILE_STORAGE,
#     'MAP_RESULTS_DEST': '',
# }
# USER_SETTINGS = DEFAULT_SETTINGS.copy()
# 
# Path: elections/fields.py
# class TestFlagField(CharField):
#     """
#     t is test data and l is live data field
#     
#     Can't override choices or max_length
#     """
#     def __init__(self, **kwargs):
#         default_args = {
#             'choices': (('t', _('Test Data')), ('l', _('Live Data'))),
#             'max_length': 1,
#             'default': {True: 't', False: 'l'}[TEST_DATA_ONLY]
#         }
#         if 'choices' in kwargs:
#             kwargs.pop('choices')
#         if 'max_length' in kwargs:
#             kwargs.pop('max_length')
#         default_args.update(kwargs)
#         super(TestFlagField, self).__init__(**default_args)


from django.db import models
from django.db.models import get_model
from django.core.files.storage import get_storage_class
from .settings import TEST_DATA_ONLY, IMAGE_MODEL, IMAGE_STORAGE
from .fields import TestFlagField
            from django.template.defaultfilters import slugify
            from django.template.defaultfilters import slugify
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
    politician_id = models.IntegerField(primary_key=True)
    slug = models.SlugField()
    ap_candidate_id = models.IntegerField(unique=True)
    candidate_number = models.IntegerField()
    first_name = models.CharField(blank=True, null=True, max_length=64)
    middle_name = models.CharField(blank=True, null=True, max_length=64)
    last_name = models.CharField(blank=True, null=True, max_length=64)
    junior = models.CharField(blank=True, null=True, max_length=16)
    use_junior = models.BooleanField(default=False)
    year_first_elected = models.IntegerField(blank=True, null=True)
    birth_date = models.DateField(blank=True, null=True)
    birth_place = models.CharField(blank=True, null=True, max_length=100)
    birth_state = models.CharField(blank=True, null=True, max_length=2)
    birth_province = models.CharField(blank=True, null=True, max_length=100)
    birth_country = models.CharField(blank=True, null=True, max_length=100)
    residence_place = models.CharField(blank=True, null=True, max_length=100)
    residence_state = models.CharField(blank=True, null=True, max_length=2)
    gender = models.CharField(
        blank=True, null=True, 
        max_length=1, 
        choices=(('M', 'Male'), ('F', 'Female')))
    ethnicity = models.CharField(blank=True, null=True, max_length=100)
    hispanic = models.CharField(blank=True, null=True, max_length=100)
    religion = models.CharField(blank=True, null=True, max_length=100)
    biography = models.TextField(blank=True, null=True)
    profile = models.TextField(blank=True, null=True)
    campaigns = models.TextField(blank=True, null=True)
    timestamp = models.DateTimeField(blank=True, null=True)
    if IMAGE_MODEL:
        photo_fk = models.ForeignKey(

# Path: elections/settings.py
# DEFAULT_SETTINGS = {
#     'TEST_DATA_ONLY': False,
#     'FTP_USER': 'anonymous',
#     'FTP_PASSWORD': '',
#     'FTP_HOST': '',
#     'DOWNLOAD_PATHS': [],
#     'DEST_PATH': '/tmp/election/',
#     'IMAGE_MODEL': None,
#     'IMAGE_STORAGE': settings.DEFAULT_FILE_STORAGE,
#     'MAP_RESULTS_DEST': '',
# }
# USER_SETTINGS = DEFAULT_SETTINGS.copy()
# 
# Path: elections/fields.py
# class TestFlagField(CharField):
#     """
#     t is test data and l is live data field
#     
#     Can't override choices or max_length
#     """
#     def __init__(self, **kwargs):
#         default_args = {
#             'choices': (('t', _('Test Data')), ('l', _('Live Data'))),
#             'max_length': 1,
#             'default': {True: 't', False: 'l'}[TEST_DATA_ONLY]
#         }
#         if 'choices' in kwargs:
#             kwargs.pop('choices')
#         if 'max_length' in kwargs:
#             kwargs.pop('max_length')
#         default_args.update(kwargs)
#         super(TestFlagField, self).__init__(**default_args)


# Path: elections/models.py
from django.db import models
from django.db.models import get_model
from django.core.files.storage import get_storage_class
from .settings import TEST_DATA_ONLY, IMAGE_MODEL, IMAGE_STORAGE
from .fields import TestFlagField
            from django.template.defaultfilters import slugify
            from django.template.defaultfilters import slugify
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib
        import hashlib

    politician_id = models.IntegerField(primary_key=True)
    slug = models.SlugField()
    ap_candidate_id = models.IntegerField(unique=True)
    candidate_number = models.IntegerField()
    first_name = models.CharField(blank=True, null=True, max_length=64)
    middle_name = models.CharField(blank=True, null=True, max_length=64)
    last_name = models.CharField(blank=True, null=True, max_length=64)
    junior = models.CharField(blank=True, null=True, max_length=16)
    use_junior = models.BooleanField(default=False)
    year_first_elected = models.IntegerField(blank=True, null=True)
    birth_date = models.DateField(blank=True, null=True)
    birth_place = models.CharField(blank=True, null=True, max_length=100)
    birth_state = models.CharField(blank=True, null=True, max_length=2)
    birth_province = models.CharField(blank=True, null=True, max_length=100)
    birth_country = models.CharField(blank=True, null=True, max_length=100)
    residence_place = models.CharField(blank=True, null=True, max_length=100)
    residence_state = models.CharField(blank=True, null=True, max_length=2)
    gender = models.CharField(
        blank=True, null=True, 
        max_length=1, 
        choices=(('M', 'Male'), ('F', 'Female')))
    ethnicity = models.CharField(blank=True, null=True, max_length=100)
    hispanic = models.CharField(blank=True, null=True, max_length=100)
    religion = models.CharField(blank=True, null=True, max_length=100)
    biography = models.TextField(blank=True, null=True)
    profile = models.TextField(blank=True, null=True)
    campaigns = models.TextField(blank=True, null=True)
    timestamp = models.DateTimeField(blank=True, null=True)
    if IMAGE_MODEL:
        photo_fk = models.ForeignKey(

            get_model(IMAGE_MODEL), 