#10647 closed (fixed)
Many-to-many tables are created even with managed=False
Reported by: | Pavel Anossov | Owned by: | Jacob |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | managed, manytomany | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
What else can I say..
django.db.backends.creation.sql_for_many_to_many has no guards whatsoever.
def sql_for_many_to_many(self, model, style): "Return the CREATE TABLE statments for all the many-to-many tables defined on a model" output = [] for f in model._meta.local_many_to_many: output.extend(self.sql_for_many_to_many_field(model, f, style)) return output
Attachments (2)
Change History (8)
by , 16 years ago
Attachment: | managedm2m.diff added |
---|
comment:1 by , 16 years ago
milestone: | → 1.1 |
---|---|
Owner: | changed from | to
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
Triage Stage: | Accepted → Design decision needed |
---|
by , 16 years ago
Attachment: | managedm2m_v2.diff added |
---|
Omit ManyToMany table creation only if both fields are managed.
comment:3 by , 16 years ago
Needs documentation: | set |
---|---|
Owner: | changed from | to
Triage Stage: | Design decision needed → Accepted |
comment:4 by , 16 years ago
"In the face of ambiguity refuse the temptation to guess." In other words, we should only explicitly omit creation if both are unmanaged.
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
patch