#27314: PointField can't be used in get_or_create
-------------------------------+--------------------
Reporter: kemar | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
- Django **1.10.2**
- PostgreSQL **9.4.9**
- PostGIS **2.2.2**
With this model:
{{{
from django.contrib.gis.db import models as gis_models
from django.db import models as django_models
class MyModel(django_models.Model):
coords = gis_models.PointField(geography=True)
}}}
Try this:
{{{
>>> i = MyModel.objects.all()[0]
>>> type(i.coords)
>>> django.contrib.gis.geos.point.Point
>>> MyModel.objects.get_or_create(coords=i.coords)
ValueError: PostGIS geography does not support the "~=" function/operator.
}}}
But [https://www.postgresql.org/docs/9.4/static/functions-geometry.html
#FUNCTIONS-GEOMETRY-OP-TABLE/ `~=` is a valid operator].
Looks like a bug to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/27314>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.44d79fd5a6570b8c55502fd46ce596b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.