

def contribute_to_class(self, cls, name):
    if (self.rel.symmetrical and ((self.rel.to == 'self') or (self.rel.to == cls._meta.object_name))):
        self.rel.related_name = ('%s_rel_+' % name)
    super(ManyToManyField, self).contribute_to_class(cls, name)
    if ((not self.rel.through) and (not cls._meta.abstract) and (not cls._meta.swapped)):
        self.rel.through = create_many_to_many_intermediary_model(self, cls)
    setattr(cls, self.name, ReverseManyRelatedObjectsDescriptor(self))
    self.m2m_db_table = curry(self._get_m2m_db_table, cls._meta)
    if isinstance(self.rel.through, six.string_types):

        def resolve_through_model(field, model, cls):
            field.rel.through = model
        add_lazy_relation(cls, self, self.rel.through, resolve_through_model)
    if isinstance(self.rel.to, six.string_types):
        target = self.rel.to
    else:
        target = self.rel.to._meta.db_table
    cls._meta.duplicate_targets[cls.column] = (target, 'm2m')

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/models/fields/related.py ManyToManyField.contribute_to_class/VarMisuse@255/325 `self`->`cls`