Ticket #3098: m2mtabelname.patch
File m2mtabelname.patch, 1.1 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/related.py
610 610 limit_choices_to=kwargs.pop('limit_choices_to', None), 611 611 raw_id_admin=kwargs.pop('raw_id_admin', False), 612 612 symmetrical=kwargs.pop('symmetrical', True)) 613 self.db_table = kwargs.pop('db_table', None) 613 614 if kwargs["rel"].raw_id_admin: 614 615 kwargs.setdefault("validator_list", []).append(self.isValidIDList) 615 616 Field.__init__(self, **kwargs) … … 632 633 633 634 def _get_m2m_db_table(self, opts): 634 635 "Function that can be curried to provide the m2m table name for this relation" 635 return '%s_%s' % (opts.db_table, self.name) 636 if self.db_table: 637 return self.db_table 638 else: 639 return '%s_%s' % (opts.db_table, self.name) 636 640 637 641 def _get_m2m_column_name(self, related): 638 642 "Function that can be curried to provide the source column name for the m2m table"