diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2013-02-02 21:08:45 -0300 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-02-02 21:11:32 -0300 |
| commit | 08dc90bccf7c4ffa8b04064d74b54c1150af5ff9 (patch) | |
| tree | 4404e8e0a61a2742bc779773c1ad21703c1a6207 /django | |
| parent | c9c40bc6bc64e67365338751e4967d86d0882abf (diff) | |
Fixed #14305 -- Switched inspectdb to create unmanaged models.
Thanks Ian Kelly for the report and initial patch.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/inspectdb.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index f9cecc2f5f..42cc9c5dfe 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -40,8 +40,9 @@ class Command(NoArgsCommand): cursor = connection.cursor() yield "# This is an auto-generated Django model module." yield "# You'll have to do the following manually to clean this up:" - yield "# * Rearrange models' order" - yield "# * Make sure each model has one field with primary_key=True" + yield "# * Rearrange models' order" + yield "# * Make sure each model has one field with primary_key=True" + yield "# * Remove `managed = False` lines for those models you wish to give write DB access" yield "# Feel free to rename the models, but don't rename db_table values or field names." yield "#" yield "# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'" @@ -224,5 +225,6 @@ class Command(NoArgsCommand): to the given database table name. """ return [" class Meta:", + " managed = False", " db_table = '%s'" % table_name, ""] |
