Opened 16 years ago

Closed 16 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: dev
Severity: Keywords: ManyToManyField
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

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 16 years ago.
patch

Download all attachments as: .zip

Change History (5)

by Evgeniy Ivanov, 16 years ago

Attachment: m2m.diff added

patch

comment:1 by Evgeniy Ivanov, 16 years ago

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 by Evgeniy Ivanov, 16 years ago

Patch needs improvement: set

comment:3 by Alex Gaynor, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:4 by Malcolm Tredinnick, 16 years ago

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