Changeset 8721
- Timestamp:
- 08/29/08 16:24:00 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/fields/related.py
r8690 r8721 717 717 if not cls._meta.one_to_one_field: 718 718 cls._meta.one_to_one_field = self 719 719 720 720 def formfield(self, **kwargs): 721 721 if self.rel.parent_link: … … 845 845 846 846 def contribute_to_class(self, cls, name): 847 # To support multiple relations to self, it's useful to have a non-None 848 # related name on symmetrical relations for internal reasons. The 849 # concept doesn't make a lot of sense externally ("you want me to 850 # specify *what* on my non-reversible relation?!"), so we set it up 851 # automatically. The funky name reduces the chance of an accidental 852 # clash. 853 if self.rel.symmetrical and self.rel.related_name is None: 854 self.rel.related_name = "%s_rel_+" % name 855 847 856 super(ManyToManyField, self).contribute_to_class(cls, name) 848 857 # Add the descriptor for the m2m relation
