Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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?

Change History (3)

comment:1 by Claude Paroz, 9 years ago

Triage Stage: UnreviewedAccepted

I think that the commit b8cdc7dcc3fc6897fb2a75f90023f5c67aad327f has been misinterpreted. It added view support for the get_table_list() introspection utility, but table_names() still returns tables only. And [ed297061a676e629983664031d77da1d0a70af7d] added optional view support for table_names(). But I'm almost sure that inspectdb never returned models for database views.

The resolution might be as simple as reverting the commit fixing #24177.

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

Resolution: fixed
Status: newclosed

In 9f0d6713:

Fixed #25038 -- Reverted incorrect documentation about inspectdb introspecting views.

This reverts commit bd691f4586c8ad45bd059ff9d3621cbf8afdcdce (refs #24177).

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

In fdaf935:

[1.8.x] Fixed #25038 -- Reverted incorrect documentation about inspectdb introspecting views.

This reverts commit e69eea73d94c058728143416058a6257c765a9b8 (refs #24177).

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