def __set__(self, instance, value):
        if instance is None:
            raise AttributeError(self.related.opts.object_name % u"%s must be accessed via instance")

        ct = None
        fk = None
        if value is not None:
            ct = self.get_content_type(obj=value)
            fk = value._get_pk_val()

        setattr(instance, self.ct_field, ct)
        setattr(instance, self.fk_field, fk)
        setattr(instance, self.cache_attr, value)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/contenttypes/generic.py/GenericForeignKey.__set__/swapped operands of `%`