Wednesday, January 2, 2019

Are distance lookups available for MySQL or not?

Hello, everybody

I am using Django 2.1 with MariaDB 10.3.
I have been trying to get the 'dwithin' lookup to work on a PointField, but I keep getting the following error:

  ...
 
File "/usr/local/lib/python3.6/site-packages/django/contrib/gis/db/models/lookups.py", line 74, in get_rhs_op
   
return connection.ops.gis_operators[self.lookup_name]
KeyError: 'dwithin'

(To be more precise, I am using this filter backend from a library, which generates the lookup for me.)

Looking at the docs, I get conflicting info:

* this section says "Availability: PostGIS, Oracle, SpatiaLite, PGRaster (Native)", implying 'not available on MySQL'
* this other section says MySQL support was added on Django 2.0

I could switch to PostgreSQL as a last resort, but maybe I'm just forgetting some configuration? Are the distance lookups available for MySQL or not?

Best regards,

Clara

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e1452b84-a33f-4121-a329-1aa03f818bf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment