This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # $ PYTHONPATH=.. ./manage.py test | |
| # Creating test database for alias 'default'... | |
| # test_list_backed_lookup | |
| # 3.81117606163 | |
| # .test_manager_backed_lookup | |
| # 6.57371211052 | |
| # . | |
| # ---------------------------------------------------------------------- | |
| # Ran 2 tests in 12.099s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/django/db/models/query.py b/django/db/models/query.py | |
| index 34e8dab..55b9ab3 100644 | |
| --- a/django/db/models/query.py | |
| +++ b/django/db/models/query.py | |
| @@ -1620,9 +1620,10 @@ class RawQuerySet(object): | |
| class Prefetch(object): | |
| - def __init__(self, lookup, queryset=None): | |
| + def __init__(self, lookup, queryset=None, parent_filter=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var localNow = new Date(); | |
| localNow.setTime(localNow.getTime() + 1); | |
| console.log(localNow); | |
| // Sat Nov 02 2013 16:09:29 GMT-0500 (CDT) | |
| var localNow = new Date(); | |
| localNow.setTime(localNow.getTime() + 1000 * 60 * 60 * 13); | |
| console.log(localNow); | |
| // Sun Nov 03 2013 04:12:22 GMT-0600 (CST) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py | |
| index 6299b20..577f503 100644 | |
| --- a/django/db/models/fields/related.py | |
| +++ b/django/db/models/fields/related.py | |
| @@ -268,7 +268,7 @@ class ReverseSingleRelatedObjectDescriptor(six.with_metaclass(RenameRelatedObjec | |
| rel_obj_attr = self.field.get_foreign_related_value | |
| instance_attr = self.field.get_local_related_value | |
| instances_dict = dict((instance_attr(inst), inst) for inst in instances) | |
| - query = {'%s__in' % self.field.related_query_name(): instances} | |
| + query = {'%s__in' % self.field.related_field.name: [rel_obj_attr(i)[0] for i in instances]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py | |
| index 6299b20..577f503 100644 | |
| --- a/django/db/models/fields/related.py | |
| +++ b/django/db/models/fields/related.py | |
| @@ -268,7 +268,7 @@ class ReverseSingleRelatedObjectDescriptor(six.with_metaclass(RenameRelatedObjec | |
| rel_obj_attr = self.field.get_foreign_related_value | |
| instance_attr = self.field.get_local_related_value | |
| instances_dict = dict((instance_attr(inst), inst) for inst in instances) | |
| - query = {'%s__in' % self.field.related_query_name(): instances} | |
| + query = {'%s__in' % self.field.related_field.name: set([instance_attr(i)[0] for i in instances])} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/django/db/models/base.py b/django/db/models/base.py | |
| index a2eee60..3515569 100644 | |
| --- a/django/db/models/base.py | |
| +++ b/django/db/models/base.py | |
| @@ -333,12 +333,12 @@ class Model(six.with_metaclass(ModelBase)): | |
| # The reason for the kwargs check is that standard iterator passes in by | |
| # args, and instantiation for iteration is 33% faster. | |
| args_len = len(args) | |
| - if args_len > len(self._meta.concrete_fields): | |
| + if args_len > len(self._meta.fields): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/django/db/models/base.py b/django/db/models/base.py | |
| index ce3f095..1d3bb12 100644 | |
| --- a/django/db/models/base.py | |
| +++ b/django/db/models/base.py | |
| @@ -360,12 +360,12 @@ class Model(six.with_metaclass(ModelBase)): | |
| # The reason for the kwargs check is that standard iterator passes in by | |
| # args, and instantiation for iteration is 33% faster. | |
| args_len = len(args) | |
| - if args_len > len(self._meta.concrete_fields): | |
| + if args_len > len(self._meta.fields): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/docs/releases/1.6.1.txt b/docs/releases/1.6.1.txt | |
| index 128a2e9..5c9bd1e 100644 | |
| --- a/docs/releases/1.6.1.txt | |
| +++ b/docs/releases/1.6.1.txt | |
| @@ -12,3 +12,6 @@ Bug fixes | |
| ========= | |
| * Fixed ``BCryptSHA256PasswordHasher`` with py-bcrypt and Python 3 (#21398). | |
| +* Fixed a regression that prevented a ``ForeignKey`` with a hidden reverse | |
| + manager (``related_name`` ending with '+') from being used as a lookup for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/docs/ref/models/relations.txt b/docs/ref/models/relations.txt | |
| index 77f2e78..62e2294 100644 | |
| --- a/docs/ref/models/relations.txt | |
| +++ b/docs/ref/models/relations.txt | |
| @@ -112,13 +112,13 @@ Related objects reference | |
| .. versionchanged 1.7:: | |
| - This method accepts a ``bulk`` argument. When ``bulk=False``, | |
| - ``QuerySet.update()`` is replaced by multiple calls to ``Model.save()``, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py | |
| index 7f30b0e..faccda1 100644 | |
| --- a/tests/forms_tests/tests/test_forms.py | |
| +++ b/tests/forms_tests/tests/test_forms.py | |
| @@ -693,6 +693,7 @@ class FormsTestCase(TestCase): | |
| self.add_error('password1', 'Forbidden value 2.') | |
| if self.cleaned_data.get('password2') == 'FORBIDDEN_VALUE2': | |
| self.add_error('password2', 'Forbidden value 2.') | |
| + raise ValidationError("I'm a non field error.") | |