#14694: defer() doesn't work with reverse relations -------------------------------------+------------------------------------- Reporter: sayane | Owner: nobody Type: Bug | Status: reopened Component: Database layer | Version: SVN (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: defer only | Needs documentation: 0 OneToOneField reverse | Patch needs improvement: 1 relationship | UI/UX: 0 Has patch: 1 | Needs tests: 0 | Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by mrmachine):
* needs_better_patch: 0 => 1 Comment: On closer inspection, this fix doesn't fully resolve the problem. `deferred_to_columns_cb()` still tries to access `field.column`, which doesn't exist on `RelatedObject`. I tried adding the actual field instead of the `RelatedObject` to `seen` and `must_include`, but I still get problems. There are probably ORM complexities that I'm missing here. One thing that has probably helped this bug to slip under the radar is that exceptions raised in `deferred_to_columns_cb()` and `deferred_to_data()` appear to be silenced in some cases. Evaluating a queryset could return no results when `.count()` shows that there are items in the set, but converting `querysey.query` to `str` raises an exception. -- Ticket URL: <https://code.djangoproject.com/ticket/14694#comment:5> 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.