diff options
| author | Michael Manfre <mmanfre@gmail.com> | 2013-09-11 11:12:56 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-09-11 13:35:26 -0400 |
| commit | e61cc87129727c66120b67c376feda3533544db1 (patch) | |
| tree | 38e3b66de4d1e6b104c68c94d9dbc25ce4c28d3f /django | |
| parent | abb10db06fb2ecb3e897462ec72417d10b39b8a4 (diff) | |
Fixed #21090 -- Allowed backends to provide dotted field path to inspectdb.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/inspectdb.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index 2cfea028ec..b4c116acab 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -117,7 +117,12 @@ class Command(NoArgsCommand): if not field_type in ('TextField(', 'CharField('): extra_params['null'] = True - field_desc = '%s = models.%s' % (att_name, field_type) + field_desc = '%s = %s%s' % ( + att_name, + # Custom fields will have a dotted path + '' if '.' in field_type else 'models.', + field_type, + ) if extra_params: if not field_desc.endswith('('): field_desc += ', ' |
