#17605: It is not documented how to work with ManyToMany relations ---------------------------------+------------------------------------ Reporter: kmike | Owner: ramiro Type: Bug | Status: assigned Component: Documentation | Version: 1.3 Severity: Release blocker | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 ---------------------------------+------------------------------------ Changes (by aaugustin):
* needs_better_patch: 0 => 1 Comment: The style shows that these documents used to be doctests, but it's a good basis IMO. __topics/db/models.txt__ * This page still refers to the "Many-to-one relationship model tests", but that link is pointing to a regular documentation page. Use the same wording as the other "See also" blocks? __topics/db/examples/many_to_one.txt__ * `a = Article(id=None, ...`: this isn't idiomatic; I'd skip the `id` kwarg entirely. * "Article objects have access to their related Reporter objects:": this was demonstrated just above, I'd reorganize this part a bit * `>>> Article.objects.filter(reporter=1)`: I didn't know this was supported, and it feels unclean. Plus, there are two ways to do the same thing. Do we really want to document this possibility? * `>>> Reporter.objects.filter(article=1)`: same comment __topics/db/examples/many_to_many.txt__ * "Add a Publication directly via publications.add...": shouldn't that be "publications.create"? * `>>> Article.objects.filter(publications=1)`: same comment again * `publications__in=[1,2]`: missing space after the comma * `publications__in=[p1,p2]`: missing space after the comma * `>>> Publication.objects.filter(article=1)`: same comment again * `article__in=[1,2]`: missing space after the comma * `article__in=[a1,a2]`: missing space after the comma * "After the delete, the QuerySet cache needs to be cleared, and the referenced objects should be gone": this sounds like an internal implementation detail, not something a developer using Django should worry about __topics/db/examples/one_to_one.txt__ * "Restaurant.objects.all()" should be in fixed width font. I hope this helps! -- Ticket URL: <https://code.djangoproject.com/ticket/17605#comment:7> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.