Loading django/core/management/commands/inspectdb.py +6 −5 Original line number Diff line number Diff line Loading @@ -50,12 +50,13 @@ class Command(NoArgsCommand): yield "from __future__ import unicode_literals" yield '' yield 'from %s import models' % self.db_module yield '' known_models = [] for table_name in connection.introspection.table_names(cursor): if table_name_filter is not None and callable(table_name_filter): if not table_name_filter(table_name): continue yield '' yield '' yield 'class %s(models.Model):' % table2model(table_name) known_models.append(table2model(table_name)) try: Loading Loading @@ -239,7 +240,7 @@ class Command(NoArgsCommand): to construct the inner Meta class for the model corresponding to the given database table name. """ return [" class Meta:", return ["", " class Meta:", " managed = False", " db_table = '%s'" % table_name, ""] " db_table = '%s'" % table_name] tests/inspectdb/tests.py +2 −2 File changed.Contains only whitespace changes. Show changes Loading
django/core/management/commands/inspectdb.py +6 −5 Original line number Diff line number Diff line Loading @@ -50,12 +50,13 @@ class Command(NoArgsCommand): yield "from __future__ import unicode_literals" yield '' yield 'from %s import models' % self.db_module yield '' known_models = [] for table_name in connection.introspection.table_names(cursor): if table_name_filter is not None and callable(table_name_filter): if not table_name_filter(table_name): continue yield '' yield '' yield 'class %s(models.Model):' % table2model(table_name) known_models.append(table2model(table_name)) try: Loading Loading @@ -239,7 +240,7 @@ class Command(NoArgsCommand): to construct the inner Meta class for the model corresponding to the given database table name. """ return [" class Meta:", return ["", " class Meta:", " managed = False", " db_table = '%s'" % table_name, ""] " db_table = '%s'" % table_name]