diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2013-05-20 17:40:34 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2013-05-20 18:02:10 +0300 |
| commit | c9a96075fa02b6d52bec748ffdfb413688a15774 (patch) | |
| tree | 5d61b70044a48ac8d916a5712d4a64fb751128f6 /django | |
| parent | d9d24c4521866247f1e5fc1150f5cb9b57979863 (diff) | |
Fixed #20378 -- regression in GenericRelation on abstract model
When a GenericRelation was defined on abstract model, queries on childs
of the abstract model didn't work. The problem was in the way fields and
in particular field.rel was copied from models to their children.
The regression was likely caused by #19385. Thanks to Gavin Wahl for
spotting the regression.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 13cec1bfba..7d01391d4f 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -157,6 +157,8 @@ class Field(object): obj = copy.copy(self) if self.rel: obj.rel = copy.copy(self.rel) + if hasattr(self.rel, 'field') and self.rel.field is self: + obj.rel.field = obj memodict[id(self)] = obj return obj |
