Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#29004 closed New feature (fixed)

Allow inspectdb to create models from database views

Reported by: Brendan Quinn Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: ORM, db, database views
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

I have added an option to the inspectdb admin command that creates Django models from database views as well as tables.

Note that #25038 is related to this feature: someone thought it already existed and wrote documentation for it. Hopefully now it works as the initial poster assumed it would.

Change History (10)

comment:1 by Ramiro Morales, 7 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham, 7 years ago

Summary: Create models from database views with inspectdb with "--include-views" optionAllow inspectdb to create models from database views

comment:3 by Mariusz Felisiak, 7 years ago

Patch needs improvement: unset

comment:4 by Carlton Gibson, 7 years ago

Patch needs improvement: set

Patch looks good. (All feedback had been adopted.)

Just needs the versionadded comment and it's good to go.

comment:5 by Carlton Gibson, 7 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Tim Graham, 7 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

I left a few comments for improvement.

comment:7 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In c2b969e1:

Fixed #29004 -- Added inspectdb --include-views option.

comment:8 by Tim Graham <timograham@…>, 7 years ago

In c3a1337d:

Refs #29004 -- Optimized InspectDBTransactionalTests.test_include_views() by limiting introspected tables.

comment:9 by Tim Graham <timograham@…>, 6 years ago

In 64f9776:

Refs #29004 -- Prevented inspectdb tests from flushing all tables data.

This is a costly operation on most database backends.

comment:10 by Tim Graham <timograham@…>, 6 years ago

In f77dd56e:

[2.1.x] Refs #29004 -- Prevented inspectdb tests from flushing all tables data.

This is a costly operation on most database backends.

Backport of 64f9776bc4a27a665032ac15f5176ced66e996e3 from master

Note: See TracTickets for help on using tickets.
Back to Top