From 61ae371649aea56ac3a34075a025fcde8420f376 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 9 Sep 2014 17:43:28 +0200 Subject: [PATCH] Do not filter maps by center distance when running spatialite --- umap/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umap/views.py b/umap/views.py index 7563041e..80d71ceb 100644 --- a/umap/views.py +++ b/umap/views.py @@ -46,7 +46,10 @@ class Home(TemplateView, PaginatorMixin): list_template_name = "leaflet_storage/map_list.html" def get_context_data(self, **kwargs): - qs = Map.public.filter(center__distance_gt=(DEFAULT_CENTER, D(km=1))) + qs = Map.public + if settings.DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3': + # Unsupported query type for sqlite. + qs = qs.filter(center__distance_gt=(DEFAULT_CENTER, D(km=1))) demo_map = None if hasattr(settings, "UMAP_DEMO_PK"): try: