#10807 closed (fixed)
'Constraint' object has no attribute 'relabel_aliases' when using | with GeoQueryset
Reported by: | Brett Hoerner | Owned by: | |
---|---|---|---|
Component: | GIS | Version: | 1.1-beta |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
from django.contrib.auth.models import User from django.contrib.gis.db import models class Place(models.Model): name = models.CharField(max_length=100) location = models.PointField() objects = models.GeoManager() def __unicode__(self): return self.name
from django.contrib.gis.geos import Point from django.contrib.gis.measure import D from djtest.models import Place point = Point(x=0, y=0) place1 = Place.objects.create(name='A', location=point) place2 = Place.objects.create(name='B', location=point) qs1 = Place.objects.filter(name='A', location__distance_lte=(point, D(mi=5))) qs2 = Place.objects.filter(name='B', location__distance_lte=(point, D(mi=5))) qs1 | qs2
Traceback (most recent call last): File "test.py", line 13, in <module> qs1 | qs2 File "/a/djtest/lib/python2.6/site-packages/django/db/models/query.py", line 163, in __or__ combined.query.combine(other.query, sql.OR) File "/a/djtest/lib/python2.6/site-packages/django/db/models/sql/query.py", line 500, in combine w.relabel_aliases(change_map) File "/a/djtest/lib/python2.6/site-packages/django/db/models/sql/where.py", line 226, in relabel_aliases child[0].relabel_aliases(change_map) AttributeError: 'Constraint' object has no attribute 'relabel_aliases'
Change History (6)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 16 years ago
Well, it looks like the first occurrence of the relabel_aliases error (rather than Constraint is not iterable error in the above comment) is in [9888],
Traceback (most recent call last): File "../djtest/test.py", line 13, in <module> print qs1 | qs2 File "/a/djtest/lib/python2.6/site-packages/django/db/models/query.py", line 256, in __or__ combined.query.combine(other.query, sql.OR) File "/a/djtest/lib/python2.6/site-packages/django/db/models/sql/query.py", line 487, in combine w.relabel_aliases(change_map) File "/a/djtest/lib/python2.6/site-packages/django/db/models/sql/where.py", line 222, in relabel_aliases child[0].relabel_aliases(change_map) AttributeError: 'Constraint' object has no attribute 'relabel_aliases'
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I used git-bisect that it broke on [9702],
[9702] were changes to catch up with [9700] on trunk, where the above test case gives the following,