#10807: 'Constraint' object has no attribute 'relabel_aliases' when using | with
GeoQueryset
--------------------------+-------------------------------------------------
 Reporter:  bretthoerner  |       Owner:  nobody    
   Status:  new           |   Milestone:  1.1       
Component:  GIS           |     Version:  1.1-beta-1
 Keywords:                |       Stage:  Unreviewed
Has_patch:  0             |  
--------------------------+-------------------------------------------------
 {{{
 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'
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10807>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to