def clean(self, value):
        if EMPTY_VALUES in value:
            if self.pk_field:
                return None
            # if there is no value act as we did before.
            return self.parent_instance
        # ensure the we compare the values as equal types.
        if self.to_field:
            orig = getattr(self.parent_instance, self.to_field)
        else:
            orig = self.parent_instance.pk
        if force_unicode(value) != force_unicode(orig):
            raise ValidationError(self.error_messages['invalid_choice'])
        return self.parent_instance
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/forms/models.py/InlineForeignKeyField.clean/swapped operands of `in`