Could you please explain ?
Because I don't think it is possible to do it that way.
For example i have the following in my models.py:
class City(models.Model):
name = models.CharField(max_length=40,db_index=True)
state_name = models.CharField(max_length=30)
location = models.PointField(null=True)
objects = models.GeoManager()
And i do the following query:
City.objects.filter(location__distance_lt=(**some_location**, D(km=30))).distance(**some_location**).order_by('distance')[:15]
How do convert this query result to WKT ?
On Monday, December 1, 2014 10:36:13 PM UTC+2, george wrote:
-- Because I don't think it is possible to do it that way.
For example i have the following in my models.py:
class City(models.Model):
name = models.CharField(max_length=40,db_index=True)
state_name = models.CharField(max_length=30)
location = models.PointField(null=True)
objects = models.GeoManager()
And i do the following query:
City.objects.filter(location__distance_lt=(**some_location**, D(km=30))).distance(**some_location**).order_by('distance')[:15]
How do convert this query result to WKT ?
On Monday, December 1, 2014 10:36:13 PM UTC+2, george wrote:
You can convert your spatial results to WKT and store them in redis.On Mon, Dec 1, 2014 at 2:45 PM, termopro <term...@gmail.com> wrote:--I am creating a website using Django 1.7 and GeoDjango. I've hit the point when i need to optimize website speed.
One of the bottlenecks is query execution. There are some queries which run slowly even when optimized. So i'd like to cache query results and store them in Redis.
The problem that i am getting is that i cannot cache some query results. Particularly the ones containing geometry types and distance calculations. I hit "TypeError: can't pickle Binary objects" error.
What is the recommended/right way of caching Django/GeoDjango QuerySets ?
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...@googlegroups.com .
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9e3818a0- .bf29-41c7-b21f-178806658417% 40googlegroups.com
For more options, visit https://groups.google.com/d/optout .
--George R. C. Silva
SIGMA Consultoria----------------------------
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/da5ae079-d502-4502-8b3b-f5eb25cc7ad3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment