Skip to content

Commit 38d02c4

Browse files
committed
remove things related to deleted models from base_viewer
full rework incoming
1 parent dc1ea36 commit 38d02c4

File tree

3 files changed

+20
-30
lines changed

3 files changed

+20
-30
lines changed

geospaas/base_viewer/forms.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
from django.utils import timezone
33
from leaflet.forms.widgets import LeafletWidget
44

5-
from geospaas.catalog.models import Source
6-
75

86
class BaseSearchForm(forms.Form):
97
""" Basic version of form for basic seaching of django-geospaas metadata """
@@ -20,8 +18,6 @@ class BaseSearchForm(forms.Form):
2018
time_coverage_start = forms.DateTimeField(
2119
initial=timezone.datetime(2000, 1, 1, tzinfo=timezone.utc))
2220
time_coverage_end = forms.DateTimeField(initial=timezone.now())
23-
source = forms.ModelMultipleChoiceField(
24-
Source.objects.all(), required=False)
2521

2622
def filter(self, ds):
2723
""" Filtering method of the form. All filtering processes are coded here """
@@ -34,12 +30,6 @@ def filter(self, ds):
3430
# Too late datasets are excluded from the filtering results
3531
ds = ds.exclude(time_coverage_start__gt=t_1)
3632

37-
src = self.cleaned_data.get('source', None)
38-
# Just the one(s) with correct selected source should pass the filtering actions
39-
# if Source is given in the input form
40-
if src:
41-
ds = ds.filter(source__in=src)
42-
4333
# spatial filtering
4434
if self.cleaned_data['polygon']:
4535
# filtering by user provided polygon

geospaas/base_viewer/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from django.urls import path
22

3-
from geospaas.base_viewer.views import IndexView, get_geometry_geojson
3+
from geospaas.base_viewer.views import IndexView#, get_geometry_geojson
44

55

66
app_name = 'base_viewer'
77
urlpatterns = [
88
path('', IndexView.as_view(), name='index'),
9-
path('geometry/<int:pk>', get_geometry_geojson, name='geometry_geojson'),
9+
# path('geometry/<int:pk>', get_geometry_geojson, name='geometry_geojson'),
1010
]

geospaas/base_viewer/views.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@
66
from django.conf import settings
77

88
from geospaas.base_viewer.forms import BaseSearchForm
9-
from geospaas.catalog.models import Dataset, GeographicLocation
9+
from geospaas.catalog.models import Dataset
1010
from geospaas.catalog.managers import LOCAL_FILE_SERVICE
1111

12-
def get_geometry_geojson(request, pk, *args, **kwargs):
13-
""" Get GeographicLocation.Geometry as GeoJSON
12+
# def get_geometry_geojson(request, pk, *args, **kwargs):
13+
# """ Get GeographicLocation.Geometry as GeoJSON
1414

15-
Parameters
16-
----------
17-
pk : int
18-
primary key of GeographicLocation object
15+
# Parameters
16+
# ----------
17+
# pk : int
18+
# primary key of GeographicLocation object
1919

20-
Returns
21-
-------
22-
response : HttpResponse
23-
GeoJSON with geometry of GeographicLocation
20+
# Returns
21+
# -------
22+
# response : HttpResponse
23+
# GeoJSON with geometry of GeographicLocation
2424

25-
"""
26-
gl = GeographicLocation.objects.filter(pk=pk)
27-
if gl.count() == 0:
28-
geojson = '{}'
29-
else:
30-
geojson = serialize('geojson', gl)
31-
return HttpResponse(geojson)
25+
# """
26+
# gl = GeographicLocation.objects.filter(pk=pk)
27+
# if gl.count() == 0:
28+
# geojson = '{}'
29+
# else:
30+
# geojson = serialize('geojson', gl)
31+
# return HttpResponse(geojson)
3232

3333

3434
class IndexView(View):

0 commit comments

Comments
 (0)