#25038 closed Bug (fixed)
Unable to import database views to models in Django 1.8.2
Reported by: | jin78 | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.8 |
Severity: | Release blocker | Keywords: | ORM, db, database views |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi
According to Django 1.8 release notes, Django ORM should be able to import database views to models:
https://docs.djangoproject.com/fr/1.8/releases/1.8/
Quote: inspectdb now introspects database views on all database backends. In previous versions, only tables (not views) were inspected.
As of version 1.8.2, Django ORM is clearly unable to import database views on PostgreSQL 9.X.
Is it expected behaviour depending on which version is used?
Note:
See TracTickets
for help on using tickets.
I think that the commit b8cdc7dcc3fc6897fb2a75f90023f5c67aad327f has been misinterpreted. It added view support for the
get_table_list()
introspection utility, buttable_names()
still returns tables only. And [ed297061a676e629983664031d77da1d0a70af7d] added optional view support fortable_names()
. But I'm almost sure thatinspectdb
never returned models for database views.The resolution might be as simple as reverting the commit fixing #24177.