Ticket #3098: m2mtablename_update_rev4415.patch
File m2mtablename_update_rev4415.patch, 1.9 KB (added by , 18 years ago) |
---|
-
django_src/django/db/models/fields/related.py
629 629 limit_choices_to=kwargs.pop('limit_choices_to', None), 630 630 raw_id_admin=kwargs.pop('raw_id_admin', False), 631 631 symmetrical=kwargs.pop('symmetrical', True)) 632 self.db_table = kwargs.pop('db_table', None) 632 633 if kwargs["rel"].raw_id_admin: 633 634 kwargs.setdefault("validator_list", []).append(self.isValidIDList) 634 635 Field.__init__(self, **kwargs) … … 651 652 652 653 def _get_m2m_db_table(self, opts): 653 654 "Function that can be curried to provide the m2m table name for this relation" 654 return '%s_%s' % (opts.db_table, self.name) 655 if self.db_table: 656 return self.db_table 657 else: 658 return '%s_%s' % (opts.db_table, self.name) 655 659 656 660 def _get_m2m_column_name(self, related): 657 661 "Function that can be curried to provide the source column name for the m2m table" -
django_src/docs/model-api.txt
874 874 force Django to add the descriptor for the reverse 875 875 relationship, allowing ``ManyToMany`` relationships to be 876 876 non-symmetrical. 877 878 ``db_table`` The name of the table to create for storing the m2m data. 879 If this isn't given, Django will use ``app_label + '_' + table1 + '_' + table2``. 877 880 878 881 ======================= ============================================================ 879 882