          self.m2m_reverse_field_name = curry(self._get_m2m_reverse_attr, related, 'name')
  
      def set_attributes_from_rel(self):
          pass
  
      def value_from_object(self, obj):
 
</s> remove from models import Person, Group, Membership, UserMembership
 </s> add from models import (Person, Group, Membership, UserMembership,
                    Car, Driver, CarDriver) </s> remove                         from_col1 = opts.pk.column
 </s> add                         from_col1 = opts.get_field_by_name(
                            field.m2m_reverse_target_field_name())[0].column </s> remove                         from_col1 = opts.pk.column
 </s> add                         from_col1 = opts.get_field_by_name(
                            field.m2m_target_field_name())[0].column </s> remove                         to_col2 = opts.pk.column
 </s> add                         to_col2 = opts.get_field_by_name(
                            field.m2m_target_field_name())[0].column
        get_m2m_rel = curry(self._get_m2m_attr, related, 'rel')
        self.m2m_target_field_name = lambda: get_m2m_rel().field_name
        get_m2m_reverse_rel = curry(self._get_m2m_reverse_attr, related, 'rel')
        self.m2m_reverse_target_field_name = lambda: get_m2m_reverse_rel().field_name

          self.m2m_reverse_field_name = curry(self._get_m2m_reverse_attr, related, 'name')
  
        get_m2m_rel = curry(self._get_m2m_attr, related, 'rel')
        self.m2m_target_field_name = lambda: get_m2m_rel().field_name
        get_m2m_reverse_rel = curry(self._get_m2m_reverse_attr, related, 'rel')
        self.m2m_reverse_target_field_name = lambda: get_m2m_reverse_rel().field_name

      def set_attributes_from_rel(self):
          pass
  
      def value_from_object(self, obj):
keep add keep keep keep keep
 Fixed #15161 - Corrected handling of ManyToManyField with through table using to_field on its ForeignKeys. Thanks to adehnert for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15330 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/db/models/fields/related.py