Opened 8 years ago

Closed 6 years ago

#4299 closed (fixed)

remove code duplication in postgresql and postgresql_psycopg2 backends

Reported by: Gary Wilson <gary.wilson@…> Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Their base.py and introspection.py modules are almost identical and cause bugs to have to be fixed in both places.

Change History (10)

comment:1 Changed 8 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 8 years ago by bp@…

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

Duplicated in #5106 and taken care of there, starting with [5949]?

comment:3 Changed 8 years ago by Barry Pederson <bp@…>

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 Changed 8 years ago by Barry Pederson <bp@…>

  • Resolution set to duplicate
  • Status changed from reopened to closed

comment:5 Changed 8 years ago by gwilson

  • Resolution duplicate deleted
  • Status changed from closed to reopened

No duplication was removed from the modules listed in the ticket description though in all of that refactoring.

comment:6 Changed 8 years ago by gwilson

(In [6165]) Refs #4299 -- Removed some code duplication in the postgresql introspection modules by letting the postgresql_psycopg2 backend use identical functions from the postgresql backend.

comment:7 Changed 8 years ago by gwilson

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

The base modules don't really have that much duplication except for in the DatabaseWrapper class, and subclassing one from the other probably isn't worth it.

comment:8 Changed 8 years ago by jason

  • Resolution fixed deleted
  • Status changed from closed to reopened

Fix imports from django.db.backends.postgresql.introspection, which imports db.backend.postgresql.base and thus psycopg in the psycopg2 backend.

comment:9 Changed 8 years ago by gwilson

[6165] backed out in [6171].

comment:10 Changed 6 years ago by mtredinnick

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

Doesn't look like there's anything much to do here any longer. Over the years, we've gradually moved more and more common stuff into django/db/backends/postgresql/. In particular, the introspection stuff in the psycopg2 backend inherits from the psycopg backend.

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