Django

Code

Ticket #3098 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] rename m2m table

Reported by: wolfram.kriesing@gmail.com Assigned to: russellm
Milestone: Component: Database wrapper
Version: Keywords: m2m
Cc: freakboy@iinet.net.au, floguy@gmail.com Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

m2mtabelname.patch (1.1 kB) - added by wolfram.kriesing@gmail.com on 12/06/06 07:55:58.
m2mtablename-doc.diff (0.6 kB) - added by wolfram.kriesing@gmail.com on 12/18/06 14:13:33.
m2mtablename_update_rev4415.patch (1.9 kB) - added by floguy@gmail.com on 01/24/07 01:49:29.
Updated this patch for SVN revision 4415.
models.py (2.4 kB) - added by floguy@gmail.com on 01/24/07 01:51:01.
Unit tests for this patch. To be placed in tests/modeltests/custom_tables/ along with an empty init.py

Change History

12/06/06 07:55:58 changed by wolfram.kriesing@gmail.com

  • attachment m2mtabelname.patch added.

12/06/06 18:22:08 changed by russellm

  • type changed from defect to enhancement.

Good idea - needs documentation and a test case.

12/08/06 03:45:59 changed by russellm

  • cc set to freakboy@iinet.net.au.
  • owner changed from adrian to russellm.
  • status changed from new to assigned.

12/18/06 14:13:33 changed by wolfram.kriesing@gmail.com

  • attachment m2mtablename-doc.diff added.

01/19/07 02:54:20 changed by Simon G. <dev@simon.net.nz>

  • keywords set to m2m.
  • needs_docs set to 1.
  • needs_tests set to 1.
  • stage changed from Unreviewed to Accepted.

01/24/07 01:49:29 changed by floguy@gmail.com

  • attachment m2mtablename_update_rev4415.patch added.

Updated this patch for SVN revision 4415.

01/24/07 01:51:01 changed by floguy@gmail.com

  • attachment models.py added.

Unit tests for this patch. To be placed in tests/modeltests/custom_tables/ along with an empty init.py

01/24/07 01:55:43 changed by floguy@gmail.com

  • cc changed from freakboy@iinet.net.au to freakboy@iinet.net.au, floguy@gmail.com.
  • needs_docs deleted.
  • needs_tests deleted.

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!

01/24/07 16:09:24 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Accepted to Ready for checkin.

Taking RussellM's comment above as a "yes" on design-decision-needed, I've moved this onto ready-for-checkin.

Thanks!

01/25/07 07:53:09 changed by russellm

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [4429]) Fixed #3098 -- Added db_table parameter to m2m fields, allowing the specification of a custom table name for the m2m table. Thanks, Wolfram Kriesing.


Add/Change #3098 ([patch] rename m2m table)




Change Properties
Action