Opened 8 years ago

Closed 8 years ago

#10037 closed (wontfix)

id column is created in ManyToMany link (relation) table

Reported by: Evgeniy Ivanov Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: ManyToManyField
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

When I use ManyToManyField, extra id field is created for link (relation) table. It's done in sql_for_many_to_many_field() function.
I didn't find any comment in the source code or anything in the docs/google, so it might be a bug rather than intentional behavior.

Attachments (1)

m2m.diff (717 bytes) - added by Evgeniy Ivanov 8 years ago.
patch

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Evgeniy Ivanov

Attachment: m2m.diff added

patch

comment:1 Changed 8 years ago by Evgeniy Ivanov

There is one more place there, where id is used and I didn't fix that. Nnow I see that it might be done intentionally.
Wayting for responce.

comment:2 Changed 8 years ago by Evgeniy Ivanov

Patch needs improvement: set

comment:3 Changed 8 years ago by Alex Gaynor

Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 8 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

This isn't a bug, in that it's intentional behaviour. Removing it would at least be backwards incompatible.

A proposal to add an API to not create that column might be interesting to discuss (in the Django 1.2 timeframe, most likely). Start a thread on django-dev when proposals are discussed for Django 1.2 if you can think of an API. Also, have a check in the ticket system -- I have a feeling there might already be a ticket open about such an API (or, at least, a discussion on the mailing lists).

Not worth removing at this time, however.

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