#10594: distance(geom) results ambiguous when the PointField can be null
---------------------------------+------------------------------------------
          Reporter:  whiteinge   |         Owner:  nobody           
            Status:  new         |     Milestone:                   
         Component:  GIS         |       Version:  SVN              
        Resolution:              |      Keywords:  distance queryset
             Stage:  Unreviewed  |     Has_patch:  1                
        Needs_docs:  0           |   Needs_tests:  0                
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Changes (by yourcelf):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 The problem seems to arise from line 49 in django/contrib/gis/measure.py
 {{{
             if not isinstance(value, float): value = float(value)
 }}}

 Where "value" is the value of the geometry field.  If the field is null,
 this becomes None, and propagates a ValueError up the stack resulting in
 an empty queryset.

 I'm attaching a patch which fixes this by altering the method which
 constructs geometry objects out of the measurement attributes to instead
 keep the attribute as "None" if the value is None.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10594#comment:1>
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 django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to