diff options
| author | Anssi Kääriäinen <anssi.kaariainen@thl.fi> | 2015-02-26 16:19:17 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-03-25 08:16:12 -0400 |
| commit | 8f30556329b64005d63b66859a74752a0b261315 (patch) | |
| tree | 73b5ac8d3be457f8061aa270437c9a957d2d622c /django/db/models/sql/query.py | |
| parent | f9c70bb3a1239ed1e04a769fd323286a5b1fde20 (diff) | |
Renamed Field.rel attribute to remote_field
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.
In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index c041ef0b07..69178680ee 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -608,7 +608,7 @@ class Query(object): if is_reverse_o2o(source): cur_model = source.related_model else: - cur_model = source.rel.to + cur_model = source.remote_field.model opts = cur_model._meta # Even if we're "just passing through" this model, we must add # both the current model's pk and the related reference field @@ -1303,7 +1303,7 @@ class Query(object): opts = int_model._meta else: final_field = opts.parents[int_model] - targets = (final_field.rel.get_related_field(),) + targets = (final_field.remote_field.get_related_field(),) opts = int_model._meta path.append(PathInfo(final_field.model._meta, opts, targets, final_field, False, True)) cur_names_with_path[1].append( |
