From c2b969e124f65d375aac969f253279085b6f7078 Mon Sep 17 00:00:00 2001 From: bquinn Date: Tue, 9 Jan 2018 16:04:56 +0000 Subject: Fixed #29004 -- Added inspectdb --include-views option. --- docs/ref/django-admin.txt | 13 +++++++++++-- docs/releases/2.1.txt | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 84ed59aa51..cf64fbfe0b 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -350,8 +350,11 @@ Specifies the database to flush. Defaults to ``default``. Introspects the database tables in the database pointed-to by the :setting:`NAME` setting and outputs a Django model module (a ``models.py`` -file) to standard output. You may choose what tables to inspect by passing -their names as arguments. +file) to standard output. + +You may choose what tables or views to inspect by passing their names as +arguments. If no arguments are provided, models are created for views only if +the :option:`--include-views` option is used. Use this if you have a legacy database with which you'd like to use Django. The script will inspect the database and create a model for each table within @@ -405,6 +408,12 @@ it because ``True`` is its default value). Specifies the database to introspect. Defaults to ``default``. +.. django-admin-option:: --include-views + +.. versionadded:: 2.1 + +If this option is provided, models are also created for database views. + ``loaddata`` ------------ diff --git a/docs/releases/2.1.txt b/docs/releases/2.1.txt index 323da06fd6..03d80115d3 100644 --- a/docs/releases/2.1.txt +++ b/docs/releases/2.1.txt @@ -155,7 +155,8 @@ Internationalization Management Commands ~~~~~~~~~~~~~~~~~~~ -* ... +* The new :option:`inspectdb --include-views` option allows creating models + for database views. Migrations ~~~~~~~~~~ -- cgit v1.3