Opened 11 years ago

Closed 10 years ago

#22603 closed Cleanup/optimization (fixed)

Reorganize code in django.db.backends

Reported by: Aymeric Augustin Owned by: Tim Graham
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: 1.8-alpha
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, database backends are split in modules inconsistently. For example:

  • in the base implementation, most classes are defined in init.py; in actual backends, most classes are in base.py;
  • in the base implementation, BaseDatabaseCreation and BaseDatabaseSchemaEditor have their own modules while other classes are defined in init.py;
  • the postgresql backend has an operations.py, other backends don't.

It would be easier to make cross-backend changes if the code was organized consistently.

Considering the size of the classes involved, I think we should put each class it its own module.

Change History (13)

comment:1 by Anssi Kääriäinen, 11 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Greg Chapple, 10 years ago

Owner: changed from nobody to Greg Chapple
Status: newassigned

comment:3 by Tim Graham, 10 years ago

We should do this late in the 1.8 release cycle when there is less of a chance we'll need to backport bug fixes to 1.7.x as reorganizing a lot of code like this will make backporting more painful.

comment:4 by Greg Chapple, 10 years ago

That sounds sensible. I'll put it on hold until closer to the release date. Is the timeline for 1.8 online anywhere? A quick search didn't reveal it.

comment:5 by Tim Graham, 10 years ago

No, we're at least a month behind on the 1.7 release, so that needs to be finished first.

comment:6 by Tim Graham, 10 years ago

Keywords: 1.8-alpha added

I'm tagging this ticket 1.8-alpha so we can try to make this change close to that date (currently scheduled for January 12) before we fork stable/1.8.x.

comment:7 by Berker Peksag, 10 years ago

gchp, are you planning to work on this? I can review your patch or take a look at this before 1.8 alpha.

comment:8 by Greg Chapple, 10 years ago

Hey berkerpeksag,
I'm not sure if I'll get time, I don't want to say I will in case I don't. Feel free to assign it to yourself if you like!
Cheers

comment:9 by Tim Graham, 10 years ago

There are still a couple large patches that touch these classes that may make it into 1.8 (in particular, PR 3669), so let's hold off a bit longer on this -- I'm thinking after the "feature freeze" on Monday, but before we cut the branch and issue an alpha release.

comment:10 by Tim Graham, 10 years ago

Owner: changed from Greg Chapple to Tim Graham

comment:11 by Tim Graham, 10 years ago

Has patch: set

comment:12 by Claude Paroz, 10 years ago

Triage Stage: AcceptedReady for checkin

Considering this is essentially code moving and the test suite is happy, I'd consider this RFC.

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

Resolution: fixed
Status: assignedclosed

In 28308078f397d1de36fd0da417ac7da2544ba12d:

Fixed #22603 -- Reorganized classes in django.db.backends.

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