Opened 7 years ago

Closed 6 years ago

#10037 closed (wontfix)

id column is created in ManyToMany link (relation) table

Reported by: powerfox 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 powerfox 7 years ago.
patch

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by powerfox

patch

comment:1 Changed 7 years ago by powerfox

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 7 years ago by powerfox

  • Patch needs improvement set

comment:3 Changed 6 years ago by Alex

  • Triage Stage changed from Unreviewed to Design decision needed

comment:4 Changed 6 years ago by mtredinnick

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

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