Implements get_or_create logic for models that inherit from
    representatives.models.HashableModel because we don't have access to model
    methods in a migration scenario.

def get_or_create(cls, **kwargs):
    """
    Implements get_or_create logic for models that inherit from
    representatives.models.HashableModel because we don't have access to model
    methods in a migration scenario.
    """

    try:
        obj = cls.objects.get(**kwargs)
        created = False
    except cls.DoesNotExist:
        obj = cls(**kwargs)
        created = True
        calculate_hash(obj)
        obj.save()

    return (obj, created)