From 36bbebc739de00f768e2011afb8fe3b9ab15331f Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 16 Apr 2008 04:32:56 +0000 Subject: queryset-refactor: Detect infinite ordering loops when relations refer to 'self'. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7429 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/sql/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql/query.py') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index d804075926..4cc1500c94 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -535,7 +535,7 @@ class Query(object): # Firstly, avoid infinite loops. if not already_seen: already_seen = set() - join_tuple = tuple(joins) + join_tuple = tuple([self.alias_map[j][TABLE_NAME] for j in joins]) if join_tuple in already_seen: raise FieldError('Infinite loop caused by ordering.') already_seen.add(join_tuple) -- cgit v1.3