mirror of
https://github.com/django/django.git
synced 2025-10-06 08:40:42 +00:00
Fixed #22778 -- Added a model Meta option to define default_related_name.
Thanks jorgecarleitao and mmardini for reviews.
This commit is contained in:
parent
de90129070
commit
87d0a3384c
7 changed files with 120 additions and 2 deletions
|
@ -20,7 +20,7 @@ DEFAULT_NAMES = ('verbose_name', 'verbose_name_plural', 'db_table', 'ordering',
|
|||
'order_with_respect_to', 'app_label', 'db_tablespace',
|
||||
'abstract', 'managed', 'proxy', 'swappable', 'auto_created',
|
||||
'index_together', 'apps', 'default_permissions',
|
||||
'select_on_save')
|
||||
'select_on_save', 'default_related_name')
|
||||
|
||||
|
||||
def normalize_together(option_together):
|
||||
|
@ -99,6 +99,8 @@ class Options(object):
|
|||
# A custom app registry to use, if you're making a separate model set.
|
||||
self.apps = apps
|
||||
|
||||
self.default_related_name = None
|
||||
|
||||
@property
|
||||
def app_config(self):
|
||||
# Don't go through get_app_config to avoid triggering imports.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue