Thread Previous • Date Previous • Date Next • Thread Next |
2. Bug in our backport of the Django 1.4 method prefetch_related The error: http://paste.ubuntu.com/1362899/ This can be exercised by running the test suite on a precise instance, install 1.3.1-4ubuntu1.4~precise1+ppa1 (with includes the backport of prefetch_related) and run the test suite of the 1.2 branch. I /think/ this is because we need the feature introduced in https://code.djangoproject.com/ticket/17003 for prefetch_related to work. This will need more investigation to be fixed properly.I've fixed it, it was some code I had missed in the original backport. There's a new package available (by the time you read this) in the experimental PPA.
I think there are still some parts that are missing.Running the test suite of the 1.2 branch on a precise instance (with the django package from the experimental ppa), I'm getting exceptions: AttributeError: 'ManyRelatedManager' object has no attribute 'query_field_name' (http://paste.ubuntu.com/1369927/).
These failures go away if I comment out the calls to prefetch_related in MAAS' code.
This is the change that your patch does to the definition of the class 'ManyRelatedManager':
http://paste.ubuntu.com/1370197/And in Django's sources, the commit 662eea116f5a188b6983f5f7c01c8247e3b6b309 (which fixes https://code.djangoproject.com/ticket/16937 and introduces prefetch_related) changes the same code this way:
http://paste.ubuntu.com/1370200/I think you've missed part of the diff (namely the introduction of the field 'query_field_name').
R.
Thread Previous • Date Previous • Date Next • Thread Next |