On Mon, 3 Oct 2011 22:07:52 +0800
Russell Keith-Magee <[email protected]> wrote:
> 1) Build your own experience with the internals of the ORM. As part
> of this learning process, document what you learn -- we would very
> much like to have better documentation of the internals of Django's
> ORM, but writing that documentation takes time.
Alright. I spent most of last night (heck, the entire last night!) digging
through files in the Django db/models/sql folder. I still don't understand half
of what I see there, but I think I might have found the root of the
select_related/values problem.
I attached another patch to #16715 (a very simple patch) which has the
potential to fix this bug in the right place
("patch-nested-foreign-keys-with-test-r16923.patch").
I think I identified two places in "django/db/models/sql/compiler.py" and
"django/db/models/sql/query.py" which make invalid assumptions about null-able
fields/references. Changing these to what I think is the correct/intended
behavior resolves the issue. More details about this in #16715.
Maybe more importantly, my patch does not to my knowledge introduce any new
bugs, as measured by the outcome of the Django test suite.
Please let me know what you think. I spent several hours on this patch, let's
hope it was not a total waste of time. ;)
Sebastian.
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.