• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nansencenter / django-geo-spaas / 18780741707

24 Oct 2025 01:08PM UTC coverage: 89.524% (-6.5%) from 95.979%
18780741707

Pull #183

github

aperrin66
add todo on tag unique constaint
Pull Request #183: Data model rework

77 of 77 new or added lines in 9 files covered. (100.0%)

33 existing lines in 2 files now uncovered.

282 of 315 relevant lines covered (89.52%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/geospaas/base_viewer/forms.py
1
from django.contrib.gis import forms
1✔
2
from django.utils import timezone
1✔
3
from leaflet.forms.widgets import LeafletWidget
1✔
4

5

6
class BaseSearchForm(forms.Form):
1✔
7
    """ Basic version of form for basic seaching of django-geospaas metadata """
8
    polygon = forms.GeometryField(label=False,
1✔
9
                                  widget=LeafletWidget(attrs={
10
                                      'settings_overrides': {
11
                                          'DEFAULT_CENTER': (89.0, 179.0),
12
                                          'DEFAULT_ZOOM': 1,
13
                                          'NO_GLOBALS': False,
14
                                          'PLUGINS': {'forms': {'auto-include': True}},
15
                                      }
16
                                  }),
17
                                  required=False)
18
    time_coverage_start = forms.DateTimeField(
1✔
19
        initial=timezone.datetime(2000, 1, 1, tzinfo=timezone.utc))
20
    time_coverage_end = forms.DateTimeField(initial=timezone.now())
1✔
21

22
    def filter(self, ds):
1✔
23
        """ Filtering method of the form. All filtering processes are coded here """
24
        # filtering based on time
UNCOV
25
        t_0 = self.cleaned_data['time_coverage_start']
×
UNCOV
26
        t_1 = self.cleaned_data['time_coverage_end']
×
27
        # Too early datasets are excluded from the filtering results
UNCOV
28
        ds = ds.exclude(time_coverage_end__lte=t_0)
×
29

30
        # Too late datasets are excluded from the filtering results
UNCOV
31
        ds = ds.exclude(time_coverage_start__gt=t_1)
×
32

33
        # spatial filtering
UNCOV
34
        if self.cleaned_data['polygon']:
×
35
            # filtering by user provided polygon
UNCOV
36
            ds = ds.filter(
×
37
                geographic_location__geometry__intersects=self.cleaned_data['polygon'])
38

39
        # sorting
UNCOV
40
        ds = ds.order_by('time_coverage_start')
×
UNCOV
41
        return ds
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc