Opened 18 years ago
Closed 18 years ago
#3098 closed enhancement (fixed)
[patch] rename m2m table
Reported by: | Owned by: | Russell Keith-Magee | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
Severity: | normal | Keywords: | m2m |
Cc: | freakboy@…, floguy@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
because i used a legacy app i needed to rename my m2m tables, this tiny patch allows the parameter db_table for ManyToManyField()
i.e. pics = models.ManyToManyField(Pic, db_table='core_pic2subchapter')
Attachments (4)
Change History (10)
by , 18 years ago
Attachment: | m2mtabelname.patch added |
---|
comment:1 by , 18 years ago
Type: | defect → enhancement |
---|
comment:2 by , 18 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
by , 18 years ago
Attachment: | m2mtablename-doc.diff added |
---|
comment:3 by , 18 years ago
Keywords: | m2m added |
---|---|
Needs documentation: | set |
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
by , 18 years ago
Attachment: | m2mtablename_update_rev4415.patch added |
---|
Updated this patch for SVN revision 4415.
by , 18 years ago
Unit tests for this patch. To be placed in tests/modeltests/custom_tables/ along with an empty init.py
comment:4 by , 18 years ago
Cc: | added |
---|---|
Needs documentation: | unset |
Needs tests: | unset |
I have made the necessary changes to bring this patch up to date with revision 4415, and have created unit tests. I think that the tests fit best in a new folder under tests/modeltests/ called custom_tables. Also, I'm not quite sure why this was flagged as needs_docs, but it must have just gotten looked over that it already had docs attached on the 18th of December. Hopefully now it'll be ready for inclusion onto the trunk!
comment:5 by , 18 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Taking RussellM's comment above as a "yes" on design-decision-needed, I've moved this onto ready-for-checkin.
Thanks!
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Good idea - needs documentation and a test case.