irie 0.0.44__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.
- irie/apps/inventory/filters.py +11 -3
- irie/apps/inventory/views.py +5 -1
- irie/apps/templates/inventory/asset-table.html +1 -1
- irie/init/data/nbe_data-california.json +232846 -0
- irie/init/data/nbi_codes-california-filtered.json +1 -0
- irie/init/data/nbi_data_cesmd.json +256032 -0
- irie/init/{getNBIData2.py → getBridgeData.py} +63 -48
- irie/init/getNBIData.py +1 -1
- {irie-0.0.44.dist-info → irie-0.0.46.dist-info}/METADATA +1 -1
- {irie-0.0.44.dist-info → irie-0.0.46.dist-info}/RECORD +13 -10
- {irie-0.0.44.dist-info → irie-0.0.46.dist-info}/WHEEL +1 -1
- {irie-0.0.44.dist-info → irie-0.0.46.dist-info}/entry_points.txt +0 -0
- {irie-0.0.44.dist-info → irie-0.0.46.dist-info}/top_level.txt +0 -0
irie/apps/inventory/filters.py
CHANGED
|
@@ -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,9 +63,16 @@ 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 (
|
|
68
|
-
asset.nbi_data and
|
|
74
|
+
asset.nbi_data and \
|
|
75
|
+
"Highway Agency District" in asset.nbi_data["NBI_BRIDGE"] and \
|
|
76
|
+
asset.nbi_data["NBI_BRIDGE"]["Highway Agency District"] == value
|
|
69
77
|
)
|
|
70
78
|
]
|
irie/apps/inventory/views.py
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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>
|