﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17461	Document the presumed order of foreign keys on the intermediary model of a self-referential m2m.	flytwokites@…	Clifford Gama	"When defining a many-to-many relationship from a model to itself and using an intermediary model,

{{{
class User(models.Model):
    name = models.CharField(max_length=100)
    
    followers = models.ManyToManyField('self', through='Relationship', symmetrical=False)

    def __unicode__(self):
        return self.name

class Relationship(models.Model):
    target = models.ForeignKey('User', related_name='r1')
    follower = models.ForeignKey('User', related_name='r2')
    created_at = models.DateTimeField(auto_now_add=True)
}}}

It seems that django determine 'from field' and 'to field' by it's definition order,
the first field always used as 'from field' and the second field always used as 'to field'.
So I MUST put `target` field defintion above the `follower` field.

I checked the document but can not found any infomation to confirm it, 
I think the document should clearly explained the rule."	Cleanup/optimization	closed	Documentation	1.3	Normal	fixed			Ready for checkin	1	0	0	0	0	0
