Ticket #13987: 13987_primary_key_fix_2.diff
File 13987_primary_key_fix_2.diff, 661 bytes (added by , 14 years ago) |
---|
-
django/db/models/options.py
113 113 # Promote the first parent link in lieu of adding yet another 114 114 # field. 115 115 field = self.parents.value_for_index(0) 116 already_created = [fld for fld in self.local_fields if fld.name == field.name] 117 if already_created: 118 field = already_created[0] 116 119 field.primary_key = True 117 120 self.setup_pk(field) 118 121 else: