Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-12 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  closed
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  PointField   | Triage Stage:  Ready for
  GeoDjango  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"da71e4bb086593b5ca76bf698358d27ead2cfed2" da71e4bb]:
 {{{
 #!CommitTicketReference repository=""
 revision="da71e4bb086593b5ca76bf698358d27ead2cfed2"
 Fixed #28896 -- Reallowed filtering a queryset with GeometryField=None.

 Regression in 58da81a5a372a69f0bac801c412b57f3cce5f188.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.53b7c5e591822bdb3c72d36b32311ae9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-12 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  closed
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  PointField   | Triage Stage:  Ready for
  GeoDjango  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"ce26ec01631b00f1d0062a18c79abc93c489b75d" ce26ec0]:
 {{{
 #!CommitTicketReference repository=""
 revision="ce26ec01631b00f1d0062a18c79abc93c489b75d"
 [2.0.x] Fixed #28896 -- Reallowed filtering a queryset with
 GeometryField=None.

 Regression in 58da81a5a372a69f0bac801c412b57f3cce5f188.

 Backport of da71e4bb086593b5ca76bf698358d27ead2cfed2 from master
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.19b10ff7f2708f03a1fb648746558095%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-12 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  closed
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  PointField   | Triage Stage:  Ready for
  GeoDjango  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"a5c60404476124c682c996bfb1eb077d59f1ec53" a5c6040]:
 {{{
 #!CommitTicketReference repository=""
 revision="a5c60404476124c682c996bfb1eb077d59f1ec53"
 [2.0.x] Refs #27985 -- Reallowed using __exact=None as an alias for
 __isnull=True if a custom lookup class with lookup_name != None is
 registered as the exact lookup.

 Regression in 58da81a5a372a69f0bac801c412b57f3cce5f188 and prerequisite
 for refs #28896.

 Backport of 10bfa876be59feec24bb6a40fa11bece808ee405 from master
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.a25626a552a95d9ccd14fc8a84f973d5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-12 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:
 Keywords:  PointField   | Triage Stage:  Ready for
  GeoDjango  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"10bfa876be59feec24bb6a40fa11bece808ee405" 10bfa876]:
 {{{
 #!CommitTicketReference repository=""
 revision="10bfa876be59feec24bb6a40fa11bece808ee405"
 Refs #27985 -- Reallowed using __exact=None as an alias for __isnull=True
 if a custom lookup class with lookup_name != None is registered as the
 exact lookup.

 Regression in 58da81a5a372a69f0bac801c412b57f3cce5f188 and prerequisite
 for refs #28896.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.c3e39d5f00c50b570093fc266eca8686%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-08 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:
 Keywords:  PointField   | Triage Stage:  Ready for
  GeoDjango  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.5e9e5ca294db7c1db1b0f4a68fdf5592%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-06 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:
 Keywords:  PointField   | Triage Stage:  Accepted
  GeoDjango  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sergey Fedoseev):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/9435 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.fc8b6d884fa3bccbaae1475888c9e2a9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-05 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  2.0
 Severity:  Release blocker  |   Resolution:
 Keywords:  PointField   | Triage Stage:  Accepted
  GeoDjango  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sergey Fedoseev):

 * status:  new => assigned
 * owner:  nobody => Sergey Fedoseev


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.76dfd6ae5633076c7d6fe82bfea040be%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-05 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
--+
 Reporter:  William Li|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  GIS   |  Version:  2.0
 Severity:  Release blocker   |   Resolution:
 Keywords:  PointField GeoDjango  | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham):

 * keywords:  QuerySet.extra PointField GeoDjango => PointField GeoDjango
 * cc: Sergey Fedoseev (added)
 * component:  Database layer (models, ORM) => GIS
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Bisected to 58da81a5a372a69f0bac801c412b57f3cce5f188. I would imagine that
 `__isnull=True` works, but we should either restore the old behavior of
 accepting `None` or document the backwards incompatibility.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.bfe74c075d832738a7b2f2de964f90b1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-05 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
 Reporter:  William Li   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet.extra   | Triage Stage:
  PointField GeoDjango   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by William Li):

 This is a suspicious commit, but I'm not well-versed enough in the query
 internals to know for sure:
 
https://github.com/django/django/commit/3b56f2191df0a437740182d49efe3be16c4d0d58

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.07cb4b763194e0c39503c68bf0f772d5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #28896: GeoDjango PointField fails to generate query if filtering on a NULL value

2017-12-05 Thread Django
#28896: GeoDjango PointField fails to generate query if filtering on a NULL 
value
-+-
   Reporter:  William|  Owner:  nobody
  Li |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.0
  layer (models, ORM)|   Keywords:  QuerySet.extra
   Severity:  Normal |  PointField GeoDjango
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Environment:
 * Python 3.6.3
 * postgres 9.6.6
 * Django 2.0

 Note: This was working under Django 1.11.7.

 {{{
 # models.py
 from django.contrib.gis.db import models

 class Restaurant(models.Model):
   location = models.PointField(blank=True, null=True, db_index=True)
 }}}


 {{{
 # tests.py
 from django.test import TestCase
 from restaurants.models import Restaurant


 class RestaurantTestCase(TestCase):
 def test_no_location(self):
 # Failing query
 Restaurant.objects.filter(location=None)
 }}}


 {{{
 $ python manage.py testCreating test database for alias 'default'...
 System check identified no issues (0 silenced).
 E
 ==
 ERROR: test_no_location (restaurants.tests.RestaurantTestCase)
 --
 Traceback (most recent call last):
   File "/home/wli/projects/point-field-bug/restaurants/tests.py", line 7,
 in test_no_location
 Restaurant.objects.filter(location=None)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/manager.py", line 82, in manager_method
 return getattr(self.get_queryset(), name)(*args, **kwargs)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/query.py", line 836, in filter
 return self._filter_or_exclude(False, *args, **kwargs)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/query.py", line 854, in _filter_or_exclude
 clone.query.add_q(Q(*args, **kwargs))
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/sql/query.py", line 1252, in add_q
 clause, _ = self._add_q(q_object, self.used_aliases)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/sql/query.py", line 1276, in _add_q
 split_subq=split_subq,
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/sql/query.py", line 1214, in build_filter
 condition = self.build_lookup(lookups, col, value)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/sql/query.py", line 1084, in build_lookup
 lookup = lookup_class(lhs, rhs)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/contrib/gis/db/models/lookups.py", line 23, in __init__
 super().__init__(lhs, rhs)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/lookups.py", line 18, in __init__
 self.rhs = self.get_prep_lookup()
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/db/models/lookups.py", line 68, in get_prep_lookup
 return self.lhs.output_field.get_prep_value(self.rhs)
   File "/home/wli/.envs/point-field-bug/lib/python3.6/site-
 packages/django/contrib/gis/db/models/fields.py", line 188, in
 get_prep_value
 raise ValueError('Cannot use object with type %s for a spatial lookup
 parameter.' % type(obj).__name__)
 ValueError: Cannot use object with type NoneType for a spatial lookup
 parameter.

 --
 Ran 1 test in 0.005s

 FAILED (errors=1)
 Destroying test database for alias 'default'...

 }}}

 Workaround:
 {{{
 Restaurant.objects.extra(where=['location IS NULL'])
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/046.04078b331cacd86eb5fe0ffd3d0f74c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.