Ticket #6095 (closed: fixed)
Opened 2 years ago
Last modified 8 months ago
Add the ability to manually create M2M intermediary models
| Reported by: | jacob | Assigned to: | floguy |
|---|---|---|---|
| Milestone: | 1.0 beta | Component: | Database layer (models, ORM) |
| Version: | SVN | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | 1 | Needs documentation: | 1 |
| Needs tests: | 0 | Patch needs improvement: | 1 |
Attachments
- manual_m2m_tests_questions.txt (4.4 kB) - added by floguy on 12/04/07 15:54:11.
- Test cases
- 6095-alpha-01.diff (9.6 kB) - added by floguy on 12/05/07 01:50:38.
- Rudimentary patch to get the base functionality working. Tests were first, then implementation.
- 6095-alpha-02.diff (13.5 kB) - added by floguy on 12/07/07 03:08:45.
- Updated patch to handle custom related_name and custom db_column on manually created foreign keys.
- 6095-alpha-03.diff (15.1 kB) - added by floguy on 12/08/07 20:48:33.
- 6095-alpha-04.diff (20.4 kB) - added by floguy on 12/09/07 23:46:27.
- 6095-alpha-05.diff (21.6 kB) - added by floguy on 12/10/07 11:46:53.
- Added extra model validation checks and tests.
- docs.diff (3.5 kB) - added by floguy on 12/18/07 17:09:05.
- Added some (fairly extensive) documentation for this ticket. Please review it to make sure it's up to snuff. I'm not as good of a writer as I am a coder :)
- 6095-beta-01.diff (21.5 kB) - added by floguy on 12/29/07 00:16:46.
- 6095-beta-02.diff (22.8 kB) - added by floguy on 01/07/08 21:00:23.
- Updated patch which disallows .add() and .remove() and has some improved test cases.
- 6095-beta-03.diff (22.6 kB) - added by floguy on 01/09/08 14:11:15.
- Realized that there was some unneeded code since .add() and .remove() were disallowed when 'through' is specified.
- docs.2.diff (3.8 kB) - added by floguy on 01/13/08 23:43:56.
- Updated the documentation to match the newest patch. Also tried to clarify some of the main points so that they were easier to understand.
- 6095-beta-04.diff (23.3 kB) - added by floguy on 02/11/08 01:48:02.
- Updated patch to [7104] and now this includes the init.py file that all of the other patches didn't.
- 6095-beta-05.diff (18.2 kB) - added by floguy on 02/22/08 18:47:55.
- Made add() and remove() dynamically added depending on intermediary model. Added an attribute on ManyToManyField? which specifies whether table creation is necessary. Fixed a few typos in the error messages. Moved get_reverse_rel_field logic into django.db.models.options as get_related_object() and refactored code accordingly. More to come.
- 6095-beta-06.diff (27.5 kB) - added by floguy on 02/22/08 22:56:29.
- Added/reworded lots of the comments to the m2m_manual doctests (maybe these tests need a rename, hmmm), and fixed some issues with the .diff that prevented parts from showing up last time.
- docs.3.diff (3.2 kB) - added by floguy on 02/23/08 16:06:37.
- Tried to rewrite the docs to be more user-centric instead of django-centric.
- 6095-qsrf.diff (26.3 kB) - added by floguy on 03/05/08 05:09:22.
- Updated the patch to apply to queryset-refactor. Currently two of my tests which pass on Trunk do not pass on qs-rf, and I'm not exactly sure why. Will have to wait to see more documentation on qs-rf before I can resolve.
- 6095-nfadmin.diff (26.8 kB) - added by floguy on 03/12/08 04:35:59.
- Updated patch for newforms-admin, with the added bonus of fixing the integration problem with the admin. Now when a ManyToManyField? specifies an intermediary model, it does not display the field in the admin.
- 6095-nfadmin.2.diff (25.9 kB) - added by floguy on 03/17/08 14:05:50.
- Made sure that create is not allowed. This was an oversight in the original patch, but now there are tests which verify that create should not be allowed on a ManyRelatedManager?. Also removed new.instancemethod craziness because it was not necessary. All tests pass.
- 6095-nfadmin.3.diff (26.7 kB) - added by brosner on 04/28/08 16:20:27.
- updated to r7500 of nfa
- 6095-trunk-withdocs.rc1.diff (29.8 kB) - added by floguy on 06/05/08 01:50:47.
- Updated to latest trunk, with some syntactic improvements and taking into account latest suggestions.
- 6095-trunk-withdocs.rc2.diff (32.3 kB) - added by floguy on 06/07/08 18:36:41.
- Fixed bug with self-referential M2M fields not working with an intermediary model, and added tests for that problem.
- 6095-trunk-withdocs.rc3.diff (32.4 kB) - added by floguy on 07/10/08 03:10:14.
- Fixed cross-app problem. My solution is perhaps a bit hackish. Seems like the better solution would be to patch the add_lazy_relation function to work with intermediary models, but when I tried to do so I ran into non-obvious race conditions. This method works, is fairly transparent in how it works, and doesn't sacrificce performance. If anyone has feedback on better ways to do this, feel free to chime in.
- 6095-r8068.diff (34.9 kB) - added by russellm on 07/24/08 09:29:55.
- Updated patch for r8068; some minor revisions
- 6095-r8068.2.diff (37.9 kB) - added by russellm on 07/24/08 09:31:24.
- Updated patch for r8068; some minor revisions
- 6095-r8090.diff (39.5 kB) - added by russellm on 07/26/08 03:28:59.
- Revised patch, with cleaned up internals (especially w.r.t field lookup)
- 6095-r8090.2.diff (46.3 kB) - added by floguy on 07/26/08 06:51:18.
- Added a few more validation checks (along with corresponding invalid_model tests), fixed a typo in documentation, added a section in admin documentation on how to integrate m2m intermediary models inline with the admin.
- 6095-rc1.diff (53.2 kB) - added by russellm on 07/26/08 09:52:14.
- First (hopefully final) release candidate for m2m-intermediates
