Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#10109 closed (fixed)

Move raw sql from models.fields.related to models.sql.query

Reported by: David Larlet Owned by: Alex Gaynor
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords:
Cc: artagnon, Jannis Leidel, Sergey Belov Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Otherwise backends which do not rely on sql can't use many-to-many relations as discussed here:
http://groups.google.com/group/django-developers/browse_thread/thread/c3cd2eb4f63aed5d/6e8de9e05424d18f
(do not care with messages from people that doesn't know how to use reply-to on mailing-lists)

Now let's discuss around the proposed patch.

Attachments (5)

patch_django_10109.20090123.diff (14.3 KB) - added by David Larlet 8 years ago.
Initial patch, without any documentation nor tests, design discussion for now
patch_django_10109.20090422.diff (14.7 KB) - added by David Larlet 8 years ago.
Update patch against r10618
m2m-refactor.r11683.diff (58.8 KB) - added by Russell Keith-Magee 7 years ago.
RC1 of the m2m refactor stemming from Alex's GSoC 2009 project
m2m-refactor.r11683.2.diff (61.6 KB) - added by Russell Keith-Magee 7 years ago.
RC2 of m2m-refactor patch. Incorporates fix for abstract base classes.
m2m-refactor.r11705.diff (61.7 KB) - added by Russell Keith-Magee 7 years ago.
RC3 for m2m-refactor patch. Incorporates unique_together fix.

Download all attachments as: .zip

Change History (18)

Changed 8 years ago by David Larlet

Initial patch, without any documentation nor tests, design discussion for now

comment:1 Changed 8 years ago by David Larlet

Needs documentation: set
Needs tests: set

comment:2 Changed 8 years ago by Jacob

Triage Stage: UnreviewedAccepted

This needs to happen as part of a bigger refactor of related fields.

comment:3 Changed 8 years ago by artagnon

Cc: artagnon added

comment:4 Changed 8 years ago by Alex Gaynor

Noting here that this(or some variant thereof) is going to be a blocker on having many to many fields work correctly with Multiple Database support(GSOC).

Changed 8 years ago by David Larlet

Update patch against r10618

comment:5 Changed 8 years ago by David Larlet

Owner: changed from David Larlet to Alex Gaynor

For the record:

[15:43]  <Alex_Gaynor> david`bgk: bitchin!  
There's probably no time for that to go in before 1.1.  
But if you remind me I'll bug the shit out of jacobkm 
and russ to get it in fterwords

I'll ping you anyway.

comment:6 Changed 7 years ago by Russell Keith-Magee

See #11795 for a related request that this ticket may make possible.

comment:7 Changed 7 years ago by Jannis Leidel

Cc: Jannis Leidel added

comment:8 Changed 7 years ago by Sergey Belov

Cc: Sergey Belov added

Changed 7 years ago by Russell Keith-Magee

Attachment: m2m-refactor.r11683.diff added

RC1 of the m2m refactor stemming from Alex's GSoC 2009 project

comment:9 Changed 7 years ago by Russell Keith-Magee

The patch I have just uploaded is ready for trunk. The code is also available on Alex Gaynor's github branch

My intention is to commit this mid next week. Feedback is welcome.

comment:10 Changed 7 years ago by Russell Keith-Magee

milestone: 1.2
Needs documentation: unset
Needs tests: unset

Changed 7 years ago by Russell Keith-Magee

Attachment: m2m-refactor.r11683.2.diff added

RC2 of m2m-refactor patch. Incorporates fix for abstract base classes.

comment:11 Changed 7 years ago by Johannes Dollinger

Another small issue: Intermediary models should have 'unique_together': (from_, to), to match the old behaviour.

Changed 7 years ago by Russell Keith-Magee

Attachment: m2m-refactor.r11705.diff added

RC3 for m2m-refactor patch. Incorporates unique_together fix.

comment:12 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [11710]) Fixed #10109 -- Removed the use of raw SQL in many-to-many fields by introducing an autogenerated through model.

This is the first part of Alex Gaynor's GSoC project to add Multi-db support to Django.

comment:13 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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