irie 0.0.45__py3-none-any.whl → 0.0.46__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of irie might be problematic. Click here for more details.

@@ -15,9 +15,10 @@ class AssetFilter(django_filters.FilterSet):
15
15
  )
16
16
 
17
17
  is_streaming = django_filters.BooleanFilter(
18
- field_name='is_complete',
18
+ # field_name='is_complete',
19
19
  label='Streaming',
20
- widget=CheckboxInput()
20
+ widget=CheckboxInput(),
21
+ method='filter_is_streaming'
21
22
  )
22
23
 
23
24
  district = django_filters.CharFilter(
@@ -62,6 +63,11 @@ class AssetFilter(django_filters.FilterSet):
62
63
  return queryset.exclude(cesmd__isnull=True).exclude(cesmd__exact='')
63
64
  return queryset
64
65
 
66
+ def filter_is_streaming(self, queryset, name, value):
67
+ if value: # Checkbox is checked
68
+ return queryset.exclude(is_complete=False).exclude(cesmd__exact='')
69
+ return queryset
70
+
65
71
  def filter_district(self, queryset, name, value):
66
72
  return [
67
73
  asset for asset in queryset if (
@@ -483,7 +483,11 @@ def asset_table_export(request):
483
483
 
484
484
  # Write data rows (customize according to your model fields)
485
485
  for asset in assets:
486
- district = asset.nbi_data["NBI_BRIDGE"]["Highway Agency District"].split(" - ")[-1]
486
+ if asset.nbi_data and "NBI_BRIDGE" in asset.nbi_data and \
487
+ "Highway Agency District" in asset.nbi_data["NBI_BRIDGE"]:
488
+ district = asset.nbi_data["NBI_BRIDGE"]["Highway Agency District"].split(" - ")[-1]
489
+ else:
490
+ district = ""
487
491
  writer.writerow([asset.calid, asset.cesmd, asset.name, district, asset.event_count])
488
492
 
489
493
  return response
@@ -163,7 +163,7 @@ table a[href^="https://"]::after
163
163
  name="is_streaming"
164
164
  id="is_streaming"
165
165
  class="form-check-input"
166
- {% if filter.form.cesmd_not_null.value %}checked{% endif %}>
166
+ {% if filter.form.is_streaming.value %}checked{% endif %}>
167
167
  <label for="is_streaming" class="form-check-label">
168
168
  {{ filter.form.is_streaming.label }}
169
169
  </label>