Opened 6 years ago

Closed 5 years ago

#13630 closed Bug (fixed)

DatabaseOperations doesn't have same constructor with SQLITE and PostgreSQL backend

Reported by: calexium Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Normal Keywords:
Cc: ian.g.kelly@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Using sqlite3 backend on Django 1.2.1, the DatabaseOperations object is constructed without any parameter (no change from older versions).

from django.db import backend


But using postgresql_psycopg2 backend, the DatabaseOperations constructor need a connection as parameter :

from django.db import backend, connection


So this is not possible to have a code working with all backends.

Attachments (1)

13630.diff (9.9 KB) - added by ramiro 5 years ago.
Patch for this issue, includes a test

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by tobias

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 5 years ago by ramiro

  • Triage Stage changed from Design decision needed to Accepted

Actually, both PosgreSQL backends are the only ones accepting the connection parameter in their __init__ methods, Oracle, MySQL suffer from the same issue as reported by this ticket. We have an inconsistency here.

comment:3 Changed 5 years ago by ikelly

  • Cc ian.g.kelly@… added

comment:4 Changed 5 years ago by julien

  • Severity set to Normal
  • Type set to Bug

Changed 5 years ago by ramiro

Patch for this issue, includes a test

comment:5 Changed 5 years ago by ramiro

  • Has patch set

comment:6 Changed 5 years ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

In [16016]:

(The changeset message doesn't reference this ticket)

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