1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #24381 -- removed ForeignObjectRel opts and to_opts

These cached properies were causing problems with pickling, and in
addition they were confusingly defined: field.rel.model._meta was
not the same as field.rel.opts.

Instead users should use field.rel.related_model._meta inplace of
field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts.
This commit is contained in:
Anssi Kääriäinen
2015-02-23 09:31:58 +02:00
committed by Tim Graham
parent 78d43a5e10
commit f95122e541
3 changed files with 14 additions and 15 deletions

View File

@@ -43,6 +43,9 @@ class PickleabilityTestCase(TestCase):
def test_membermethod_as_default(self):
self.assert_pickles(Happening.objects.filter(number4=1))
def test_filter_reverse_fk(self):
self.assert_pickles(Group.objects.filter(event=1))
def test_doesnotexist_exception(self):
# Ticket #17776
original = Event.DoesNotExist("Doesn't exist")