chellow 1761571905.0.0__py3-none-any.whl → 1761645803.0.0__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 chellow might be problematic. Click here for more details.
- chellow/e/views.py +32 -23
- chellow/gas/views.py +4 -4
- chellow/reports/report_169.py +3 -3
- chellow/reports/report_247.py +3 -3
- chellow/reports/report_59.py +2 -2
- chellow/reports/report_channel_snags.py +4 -4
- chellow/reports/report_csv_site_hh_data.py +7 -4
- chellow/templates/e/em_hh_data.html +0 -1
- chellow/templates/e/em_site.html +13 -2
- chellow/utils.py +13 -0
- chellow/views.py +4 -4
- {chellow-1761571905.0.0.dist-info → chellow-1761645803.0.0.dist-info}/METADATA +1 -1
- {chellow-1761571905.0.0.dist-info → chellow-1761645803.0.0.dist-info}/RECORD +14 -14
- {chellow-1761571905.0.0.dist-info → chellow-1761645803.0.0.dist-info}/WHEEL +0 -0
chellow/e/views.py
CHANGED
|
@@ -104,7 +104,7 @@ from chellow.utils import (
|
|
|
104
104
|
hh_range,
|
|
105
105
|
parse_hh_start,
|
|
106
106
|
parse_mpan_core,
|
|
107
|
-
|
|
107
|
+
req_checkbox,
|
|
108
108
|
req_date,
|
|
109
109
|
req_decimal,
|
|
110
110
|
req_file,
|
|
@@ -230,7 +230,7 @@ def channel_add_get(era_id):
|
|
|
230
230
|
@e.route("/eras/<int:era_id>/add_channel", methods=["POST"])
|
|
231
231
|
def channel_add_post(era_id):
|
|
232
232
|
try:
|
|
233
|
-
imp_related =
|
|
233
|
+
imp_related = req_checkbox("imp_related")
|
|
234
234
|
channel_type = req_str("channel_type")
|
|
235
235
|
era = Era.get_by_id(g.sess, era_id)
|
|
236
236
|
channel = era.insert_channel(g.sess, imp_related, channel_type)
|
|
@@ -357,7 +357,7 @@ def channel_snags_get():
|
|
|
357
357
|
else:
|
|
358
358
|
contract = Contract.get_dc_by_id(g.sess, contract_id)
|
|
359
359
|
days_hidden = req_int("days_hidden")
|
|
360
|
-
is_ignored =
|
|
360
|
+
is_ignored = req_checkbox("is_ignored")
|
|
361
361
|
|
|
362
362
|
cutoff_date = utc_datetime_now() - relativedelta(days=days_hidden)
|
|
363
363
|
|
|
@@ -435,7 +435,7 @@ def channel_snag_edit_get(snag_id):
|
|
|
435
435
|
@e.route("/channel_snags/<int:snag_id>/edit", methods=["POST"])
|
|
436
436
|
def channel_snag_edit_post(snag_id):
|
|
437
437
|
try:
|
|
438
|
-
ignore =
|
|
438
|
+
ignore = req_checkbox("ignore")
|
|
439
439
|
snag = Snag.get_by_id(g.sess, snag_id)
|
|
440
440
|
snag.set_is_ignored(ignore)
|
|
441
441
|
g.sess.commit()
|
|
@@ -1532,7 +1532,7 @@ def dc_rate_script_edit_post(dc_rate_script_id):
|
|
|
1532
1532
|
dc_contract = dc_rate_script.contract
|
|
1533
1533
|
script = req_zish("script")
|
|
1534
1534
|
start_date = req_date("start")
|
|
1535
|
-
has_finished =
|
|
1535
|
+
has_finished = req_checkbox("has_finished")
|
|
1536
1536
|
finish_date = req_date("finish") if has_finished else None
|
|
1537
1537
|
dc_contract.update_rate_script(
|
|
1538
1538
|
g.sess, dc_rate_script, start_date, finish_date, script
|
|
@@ -1613,7 +1613,7 @@ def dno_rate_script_edit_post(dno_rate_script_id):
|
|
|
1613
1613
|
dno = Party.get_dno_by_code(g.sess, contract.name, rate_script.start_date)
|
|
1614
1614
|
script = req_zish("script")
|
|
1615
1615
|
start_date = req_date("start")
|
|
1616
|
-
has_finished =
|
|
1616
|
+
has_finished = req_checkbox("has_finished")
|
|
1617
1617
|
finish_date = req_date("finish") if has_finished else None
|
|
1618
1618
|
contract.update_rate_script(
|
|
1619
1619
|
g.sess, rate_script, start_date, finish_date, script
|
|
@@ -1817,7 +1817,7 @@ def era_edit_form_get(era_id):
|
|
|
1817
1817
|
else:
|
|
1818
1818
|
start_date = era.start_date
|
|
1819
1819
|
|
|
1820
|
-
is_ended =
|
|
1820
|
+
is_ended = req_checkbox("is_ended")
|
|
1821
1821
|
if is_ended:
|
|
1822
1822
|
if "finish_year" in request.values:
|
|
1823
1823
|
finish_date = req_hh_date("finish")
|
|
@@ -2176,7 +2176,7 @@ def era_edit_post(era_id):
|
|
|
2176
2176
|
return chellow_redirect(f"/supplies/{era.supply.id}", 303)
|
|
2177
2177
|
else:
|
|
2178
2178
|
start_date = req_date("start")
|
|
2179
|
-
is_ended =
|
|
2179
|
+
is_ended = req_checkbox("is_ended")
|
|
2180
2180
|
if is_ended:
|
|
2181
2181
|
finish_date = req_hh_date("finish")
|
|
2182
2182
|
else:
|
|
@@ -2213,8 +2213,8 @@ def era_edit_post(era_id):
|
|
|
2213
2213
|
else:
|
|
2214
2214
|
dtc_meter_type = DtcMeterType.get_by_id(g.sess, dtc_meter_type_id)
|
|
2215
2215
|
|
|
2216
|
-
has_imp_mpan =
|
|
2217
|
-
has_exp_mpan =
|
|
2216
|
+
has_imp_mpan = req_checkbox("has_imp_mpan")
|
|
2217
|
+
has_exp_mpan = req_checkbox("has_exp_mpan")
|
|
2218
2218
|
|
|
2219
2219
|
if has_imp_mpan:
|
|
2220
2220
|
imp_mpan_core_raw = req_str("imp_mpan_core")
|
|
@@ -2637,7 +2637,7 @@ def llfc_edit_post(llfc_id):
|
|
|
2637
2637
|
llfc = Llfc.get_by_id(g.sess, llfc_id)
|
|
2638
2638
|
voltage_level_id = req_int("voltage_level_id")
|
|
2639
2639
|
voltage_level = VoltageLevel.get_by_id(g.sess, voltage_level_id)
|
|
2640
|
-
is_substation =
|
|
2640
|
+
is_substation = req_checkbox("is_substation")
|
|
2641
2641
|
llfc.update(
|
|
2642
2642
|
llfc.description,
|
|
2643
2643
|
voltage_level,
|
|
@@ -3583,7 +3583,7 @@ def mtc_participant_get(mtc_participant_id):
|
|
|
3583
3583
|
def mtc_sscs_get():
|
|
3584
3584
|
participant_id = req_int("participant_id")
|
|
3585
3585
|
participant = Participant.get_by_id(g.sess, participant_id)
|
|
3586
|
-
only_ongoing =
|
|
3586
|
+
only_ongoing = req_checkbox("only_ongoing")
|
|
3587
3587
|
q = (
|
|
3588
3588
|
select(MtcSsc)
|
|
3589
3589
|
.join(MtcParticipant)
|
|
@@ -3641,7 +3641,7 @@ def mtc_ssc_get(mtc_ssc_id):
|
|
|
3641
3641
|
def mtc_llfcs_get():
|
|
3642
3642
|
participant_id = req_int("participant_id")
|
|
3643
3643
|
participant = Participant.get_by_id(g.sess, participant_id)
|
|
3644
|
-
only_ongoing =
|
|
3644
|
+
only_ongoing = req_checkbox("only_ongoing")
|
|
3645
3645
|
q = (
|
|
3646
3646
|
select(MtcLlfc)
|
|
3647
3647
|
.join(MtcParticipant)
|
|
@@ -3699,7 +3699,7 @@ def mtc_llfc_get(mtc_llfc_id):
|
|
|
3699
3699
|
def mtc_llfc_ssc_pcs_get():
|
|
3700
3700
|
dno_id = req_int("dno_id")
|
|
3701
3701
|
dno = Party.get_dno_by_id(g.sess, dno_id)
|
|
3702
|
-
only_ongoing =
|
|
3702
|
+
only_ongoing = req_checkbox("only_ongoing")
|
|
3703
3703
|
q = (
|
|
3704
3704
|
select(MtcLlfcSscPc)
|
|
3705
3705
|
.join(Pc)
|
|
@@ -3786,7 +3786,7 @@ def mtc_llfc_ssc_pc_get(combo_id):
|
|
|
3786
3786
|
def mtc_llfc_sscs_get():
|
|
3787
3787
|
participant_id = req_int("participant_id")
|
|
3788
3788
|
participant = Participant.get_by_id(g.sess, participant_id)
|
|
3789
|
-
only_ongoing =
|
|
3789
|
+
only_ongoing = req_checkbox("only_ongoing")
|
|
3790
3790
|
q = (
|
|
3791
3791
|
select(MtcLlfcSsc)
|
|
3792
3792
|
.join(Llfc)
|
|
@@ -4072,7 +4072,13 @@ def site_energy_management_get(site_id):
|
|
|
4072
4072
|
site = Site.get_by_id(g.sess, site_id)
|
|
4073
4073
|
|
|
4074
4074
|
now = utc_datetime_now()
|
|
4075
|
-
|
|
4075
|
+
now_ct = to_ct(now)
|
|
4076
|
+
months = list(
|
|
4077
|
+
c_months_u(finish_year=now_ct.year, finish_month=now_ct.month, months=2)
|
|
4078
|
+
)
|
|
4079
|
+
last_month_start, last_month_finish = months[0]
|
|
4080
|
+
last_month_start_ct = to_ct(last_month_start)
|
|
4081
|
+
last_month_finish_ct = to_ct(last_month_finish)
|
|
4076
4082
|
|
|
4077
4083
|
supply_dicts = []
|
|
4078
4084
|
for era in g.sess.scalars(
|
|
@@ -4096,7 +4102,10 @@ def site_energy_management_get(site_id):
|
|
|
4096
4102
|
site=site,
|
|
4097
4103
|
supply_dicts=supply_dicts,
|
|
4098
4104
|
now=now,
|
|
4099
|
-
|
|
4105
|
+
last_month_start=last_month_start,
|
|
4106
|
+
last_month_finish=last_month_finish,
|
|
4107
|
+
last_month_start_ct=last_month_start_ct,
|
|
4108
|
+
last_month_finish_ct=last_month_finish_ct,
|
|
4100
4109
|
)
|
|
4101
4110
|
|
|
4102
4111
|
|
|
@@ -4127,7 +4136,7 @@ def site_snag_edit_get(snag_id):
|
|
|
4127
4136
|
@e.route("/site_snags/<int:snag_id>/edit", methods=["POST"])
|
|
4128
4137
|
def site_snag_edit_post(snag_id):
|
|
4129
4138
|
try:
|
|
4130
|
-
ignore =
|
|
4139
|
+
ignore = req_checkbox("ignore")
|
|
4131
4140
|
snag = Snag.get_by_id(g.sess, snag_id)
|
|
4132
4141
|
snag.set_is_ignored(ignore)
|
|
4133
4142
|
g.sess.commit()
|
|
@@ -4182,10 +4191,10 @@ def em_hh_data_get(site_id):
|
|
|
4182
4191
|
caches = {}
|
|
4183
4192
|
site = Site.get_by_id(g.sess, site_id)
|
|
4184
4193
|
|
|
4185
|
-
|
|
4186
|
-
|
|
4194
|
+
timestamp = req_date("timestamp", resolution="month")
|
|
4195
|
+
ts_ct = to_ct(timestamp)
|
|
4187
4196
|
start_date, finish_date = next(
|
|
4188
|
-
c_months_u(start_year=year, start_month=month, months=1)
|
|
4197
|
+
c_months_u(start_year=ts_ct.year, start_month=ts_ct.month, months=1)
|
|
4189
4198
|
)
|
|
4190
4199
|
|
|
4191
4200
|
supplies = (
|
|
@@ -5909,7 +5918,7 @@ def supplier_rate_script_edit_post(rate_script_id):
|
|
|
5909
5918
|
contract = rate_script.contract
|
|
5910
5919
|
script = req_zish("script")
|
|
5911
5920
|
start_date = req_date("start")
|
|
5912
|
-
has_finished =
|
|
5921
|
+
has_finished = req_checkbox("has_finished")
|
|
5913
5922
|
finish_date = req_date("finish") if has_finished else None
|
|
5914
5923
|
contract.update_rate_script(
|
|
5915
5924
|
g.sess, rate_script, start_date, finish_date, script
|
|
@@ -6202,7 +6211,7 @@ def supply_get(supply_id):
|
|
|
6202
6211
|
def supply_months_get(supply_id):
|
|
6203
6212
|
supply = Supply.get_by_id(g.sess, supply_id)
|
|
6204
6213
|
|
|
6205
|
-
is_import =
|
|
6214
|
+
is_import = req_checkbox("is_import")
|
|
6206
6215
|
year = req_int("year")
|
|
6207
6216
|
years = req_int("years")
|
|
6208
6217
|
|
chellow/gas/views.py
CHANGED
|
@@ -51,7 +51,7 @@ from chellow.models import (
|
|
|
51
51
|
from chellow.utils import (
|
|
52
52
|
HH,
|
|
53
53
|
csv_make_val,
|
|
54
|
-
|
|
54
|
+
req_checkbox,
|
|
55
55
|
req_date,
|
|
56
56
|
req_decimal,
|
|
57
57
|
req_file,
|
|
@@ -869,7 +869,7 @@ def era_edit_post(g_era_id):
|
|
|
869
869
|
|
|
870
870
|
else:
|
|
871
871
|
start_date = req_date("start")
|
|
872
|
-
is_ended =
|
|
872
|
+
is_ended = req_checkbox("is_ended")
|
|
873
873
|
finish_date = req_date("finish") if is_ended else None
|
|
874
874
|
msn = req_str("msn")
|
|
875
875
|
correction_factor = req_decimal("correction_factor")
|
|
@@ -1363,7 +1363,7 @@ def industry_rate_script_edit_post(g_rate_script_id):
|
|
|
1363
1363
|
else:
|
|
1364
1364
|
script = req_zish("script")
|
|
1365
1365
|
start_date = req_date("start")
|
|
1366
|
-
has_finished =
|
|
1366
|
+
has_finished = req_checkbox("has_finished")
|
|
1367
1367
|
finish_date = req_date("finish") if has_finished else None
|
|
1368
1368
|
g_contract.update_g_rate_script(
|
|
1369
1369
|
g.sess, g_rate_script, start_date, finish_date, script
|
|
@@ -1729,7 +1729,7 @@ def supplier_rate_script_edit_post(g_rate_script_id):
|
|
|
1729
1729
|
else:
|
|
1730
1730
|
script = req_zish("script")
|
|
1731
1731
|
start_date = req_date("start")
|
|
1732
|
-
has_finished =
|
|
1732
|
+
has_finished = req_checkbox("has_finished")
|
|
1733
1733
|
finish_date = req_date("finish") if has_finished else None
|
|
1734
1734
|
g_contract.update_g_rate_script(
|
|
1735
1735
|
g.sess, g_rate_script, start_date, finish_date, script
|
chellow/reports/report_169.py
CHANGED
|
@@ -16,7 +16,7 @@ from chellow.utils import (
|
|
|
16
16
|
ct_datetime,
|
|
17
17
|
hh_range,
|
|
18
18
|
parse_mpan_core,
|
|
19
|
-
|
|
19
|
+
req_checkbox,
|
|
20
20
|
req_date,
|
|
21
21
|
req_int,
|
|
22
22
|
req_str,
|
|
@@ -249,9 +249,9 @@ def handle_request(mpan_cores=None):
|
|
|
249
249
|
|
|
250
250
|
finish_date = to_utc(ct_datetime(finish_year, finish_month, finish_day, 23, 30))
|
|
251
251
|
|
|
252
|
-
imp_related =
|
|
252
|
+
imp_related = req_checkbox("imp_related")
|
|
253
253
|
channel_type = req_str("channel_type")
|
|
254
|
-
is_zipped =
|
|
254
|
+
is_zipped = req_checkbox("is_zipped")
|
|
255
255
|
supply_id = req_int("supply_id") if "supply_id" in request.values else None
|
|
256
256
|
user = g.user
|
|
257
257
|
args = (
|
chellow/reports/report_247.py
CHANGED
|
@@ -43,7 +43,7 @@ from chellow.utils import (
|
|
|
43
43
|
hh_min,
|
|
44
44
|
hh_range,
|
|
45
45
|
make_val,
|
|
46
|
-
|
|
46
|
+
req_checkbox,
|
|
47
47
|
req_int,
|
|
48
48
|
req_str,
|
|
49
49
|
to_utc,
|
|
@@ -1088,7 +1088,7 @@ def do_post(sess):
|
|
|
1088
1088
|
scenario_props["scenario_start_month"] = start_date.month
|
|
1089
1089
|
scenario_props["scenario_duration"] = months
|
|
1090
1090
|
|
|
1091
|
-
scenario_props["by_hh"] =
|
|
1091
|
+
scenario_props["by_hh"] = req_checkbox("by_hh")
|
|
1092
1092
|
|
|
1093
1093
|
try:
|
|
1094
1094
|
if "site_id" in request.values:
|
|
@@ -1116,7 +1116,7 @@ def do_post(sess):
|
|
|
1116
1116
|
exp_mpan_core if imp_mpan_core is None else imp_mpan_core
|
|
1117
1117
|
]
|
|
1118
1118
|
|
|
1119
|
-
compression =
|
|
1119
|
+
compression = req_checkbox("compression")
|
|
1120
1120
|
|
|
1121
1121
|
user = g.user
|
|
1122
1122
|
|
chellow/reports/report_59.py
CHANGED
|
@@ -42,7 +42,7 @@ from chellow.utils import (
|
|
|
42
42
|
hh_range,
|
|
43
43
|
make_val,
|
|
44
44
|
parse_mpan_core,
|
|
45
|
-
|
|
45
|
+
req_checkbox,
|
|
46
46
|
req_hh_date,
|
|
47
47
|
req_int,
|
|
48
48
|
req_str,
|
|
@@ -1011,7 +1011,7 @@ def content(
|
|
|
1011
1011
|
|
|
1012
1012
|
def do_post(sess):
|
|
1013
1013
|
base_name = ["duration"]
|
|
1014
|
-
compression =
|
|
1014
|
+
compression = req_checkbox("compression")
|
|
1015
1015
|
|
|
1016
1016
|
try:
|
|
1017
1017
|
if "scenario_id" in request.values:
|
|
@@ -28,7 +28,7 @@ from chellow.models import (
|
|
|
28
28
|
from chellow.utils import (
|
|
29
29
|
csv_make_val,
|
|
30
30
|
hh_before,
|
|
31
|
-
|
|
31
|
+
req_checkbox,
|
|
32
32
|
req_date,
|
|
33
33
|
req_int,
|
|
34
34
|
req_int_none,
|
|
@@ -242,10 +242,10 @@ LIMIT = 200
|
|
|
242
242
|
def do_get(sess):
|
|
243
243
|
contract_id = req_int_none("dc_contract_id")
|
|
244
244
|
days_hidden = req_int("days_hidden")
|
|
245
|
-
is_ignored =
|
|
246
|
-
only_ongoing =
|
|
245
|
+
is_ignored = req_checkbox("is_ignored")
|
|
246
|
+
only_ongoing = req_checkbox("only_ongoing")
|
|
247
247
|
show_settlement = req_str("show_settlement")
|
|
248
|
-
as_csv =
|
|
248
|
+
as_csv = req_checkbox("as_csv")
|
|
249
249
|
days_long_hidden = req_int_none("days_long_hidden")
|
|
250
250
|
if "now_year" in request.values:
|
|
251
251
|
now = req_date("now")
|
|
@@ -10,13 +10,13 @@ from sqlalchemy.orm import joinedload
|
|
|
10
10
|
|
|
11
11
|
from chellow.dloads import open_file
|
|
12
12
|
from chellow.models import Era, Session, Site, SiteEra, Source, Supply, User
|
|
13
|
-
from chellow.utils import req_date, req_int, write_row
|
|
13
|
+
from chellow.utils import req_checkbox, req_date, req_int, write_row
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
TYPE_ORDER = {"hh": 0, "amr": 1, "nhh": 2, "unmetered": 3}
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def content(start_date, finish_date, site_id, user_id):
|
|
19
|
+
def content(start_date, finish_date, site_id, user_id, exclude_virtual):
|
|
20
20
|
try:
|
|
21
21
|
with Session() as sess:
|
|
22
22
|
user = User.get_by_id(sess, user_id)
|
|
@@ -82,7 +82,9 @@ def content(start_date, finish_date, site_id, user_id):
|
|
|
82
82
|
sources_str = ",".join(sorted(list(sources)))
|
|
83
83
|
generators_str = ",".join(sorted(list(generator_types)))
|
|
84
84
|
|
|
85
|
-
for hh in site.hh_data(
|
|
85
|
+
for hh in site.hh_data(
|
|
86
|
+
sess, start_date, finish_date, exclude_virtual=exclude_virtual
|
|
87
|
+
):
|
|
86
88
|
write_row(
|
|
87
89
|
writer,
|
|
88
90
|
site.code,
|
|
@@ -114,11 +116,12 @@ def content(start_date, finish_date, site_id, user_id):
|
|
|
114
116
|
def do_get(sess):
|
|
115
117
|
start_date = req_date("start")
|
|
116
118
|
finish_date = req_date("finish")
|
|
119
|
+
exclude_virtual = req_checkbox("exclude_virtual")
|
|
117
120
|
if "site_id" in request.values:
|
|
118
121
|
site_id = req_int("site_id")
|
|
119
122
|
else:
|
|
120
123
|
site_id = None
|
|
121
124
|
|
|
122
|
-
args = start_date, finish_date, site_id, g.user.id
|
|
125
|
+
args = start_date, finish_date, site_id, g.user.id, exclude_virtual
|
|
123
126
|
threading.Thread(target=content, args=args).start()
|
|
124
127
|
return redirect("/downloads", 303)
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
{% block content %}
|
|
15
15
|
<form action="/e/sites/{{site.id}}/energy_management/hh_data">
|
|
16
16
|
<fieldset>
|
|
17
|
-
<label>Site Code </label> {{input_text('site_code', site.code)}}
|
|
18
17
|
<label>Month</label> {{input_date(resolution='month')}}
|
|
19
18
|
<input type="submit" value="Show">
|
|
20
19
|
</fieldset>
|
chellow/templates/e/em_site.html
CHANGED
|
@@ -82,13 +82,24 @@
|
|
|
82
82
|
|
|
83
83
|
<ul>
|
|
84
84
|
<li>
|
|
85
|
-
<a href="/e/sites/{{site.id}}/energy_management/months?finish_year={{
|
|
85
|
+
<a href="/e/sites/{{site.id}}/energy_management/months?finish_year={{last_month_start_ct.year}}&finish_month={{last_month_start_ct.month}}">Site Data By Month</a>
|
|
86
86
|
</li>
|
|
87
87
|
<li>
|
|
88
|
-
<a href="/e/sites/{{site.id}}/energy_management/hh_data?
|
|
88
|
+
<a href="/e/sites/{{site.id}}/energy_management/hh_data?timestamp_year={{now.year}}×tamp_month={{now.month}}">HH Data</a>
|
|
89
89
|
</li>
|
|
90
90
|
</ul>
|
|
91
91
|
|
|
92
|
+
<form action="/reports/csv_site_hh_data">
|
|
93
|
+
<fieldset>
|
|
94
|
+
<input type="hidden" name="site_id" value="{{site.id}}">
|
|
95
|
+
<input type="hidden" name="exclude_virtual" value="true">
|
|
96
|
+
<legend>HH Data CSV: HH Per Row Format</legend>
|
|
97
|
+
<label>From</label> {{input_date('start', last_month_start)}}
|
|
98
|
+
<label>To</label> {{input_date('finish', last_month_finish)}}
|
|
99
|
+
<input type="submit" value="Download">
|
|
100
|
+
</fieldset>
|
|
101
|
+
</form>
|
|
102
|
+
|
|
92
103
|
<form hx-get="/e/sites/{{site.id}}/energy_management/totals">
|
|
93
104
|
<fieldset>
|
|
94
105
|
<legend>Calculate virtual bills for the last 12 months</legend>
|
chellow/utils.py
CHANGED
|
@@ -37,6 +37,19 @@ def req_strs(name):
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def req_bool(name):
|
|
40
|
+
val = req_str(name)
|
|
41
|
+
if val == "true":
|
|
42
|
+
return True
|
|
43
|
+
elif val == "false":
|
|
44
|
+
return False
|
|
45
|
+
else:
|
|
46
|
+
raise BadRequest(
|
|
47
|
+
f"Problem parsing the field {name} with values {val} as a boolean: "
|
|
48
|
+
f"expected 'true' or 'false'."
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def req_checkbox(name):
|
|
40
53
|
return name in request.values
|
|
41
54
|
|
|
42
55
|
|
chellow/views.py
CHANGED
|
@@ -115,7 +115,7 @@ from chellow.utils import (
|
|
|
115
115
|
ct_datetime,
|
|
116
116
|
ct_datetime_now,
|
|
117
117
|
hh_range,
|
|
118
|
-
|
|
118
|
+
req_checkbox,
|
|
119
119
|
req_date,
|
|
120
120
|
req_decimal,
|
|
121
121
|
req_file,
|
|
@@ -1406,7 +1406,7 @@ def report_run_get(run_id):
|
|
|
1406
1406
|
else:
|
|
1407
1407
|
element = "problem"
|
|
1408
1408
|
|
|
1409
|
-
hide_checked =
|
|
1409
|
+
hide_checked = req_checkbox("hide_checked")
|
|
1410
1410
|
|
|
1411
1411
|
ROW_LIMIT = 200
|
|
1412
1412
|
q = select(ReportRunRow).where(ReportRunRow.report_run == run).limit(ROW_LIMIT)
|
|
@@ -1627,7 +1627,7 @@ def report_run_delete(run_id):
|
|
|
1627
1627
|
@home.route("/report_runs/<int:run_id>", methods=["POST"])
|
|
1628
1628
|
def report_run_post(run_id):
|
|
1629
1629
|
run = g.sess.scalar(select(ReportRun).where(ReportRun.id == run_id))
|
|
1630
|
-
keep =
|
|
1630
|
+
keep = req_checkbox("keep")
|
|
1631
1631
|
|
|
1632
1632
|
run_data = run.data
|
|
1633
1633
|
run_data["keep"] = keep
|
|
@@ -1749,7 +1749,7 @@ def report_run_row_post(row_id):
|
|
|
1749
1749
|
row = g.sess.query(ReportRunRow).filter(ReportRunRow.id == row_id).one()
|
|
1750
1750
|
|
|
1751
1751
|
if row.report_run.name == "bill_check":
|
|
1752
|
-
is_checked =
|
|
1752
|
+
is_checked = req_checkbox("is_checked")
|
|
1753
1753
|
note = req_str("note")
|
|
1754
1754
|
|
|
1755
1755
|
properties = row.data.get("properties", {})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1761645803.0.0
|
|
4
4
|
Summary: Web Application for checking UK energy bills.
|
|
5
5
|
Project-URL: Homepage, https://github.com/WessexWater/chellow
|
|
6
6
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -11,8 +11,8 @@ chellow/proxy.py,sha256=cVXIktPlX3tQ1BYcwxq0nJXKE6r3DtFTtfFHPq55HaM,1351
|
|
|
11
11
|
chellow/rate_server.py,sha256=RwJo-AzBIdzxx7PAtboZEUH1nUjAeJckw0bk06-9oyM,5672
|
|
12
12
|
chellow/rrun.py,sha256=sWm_tuJ_6xH3T28TY1w63k1Q44N_S_p_pYF5YCeztqU,2226
|
|
13
13
|
chellow/testing.py,sha256=Dj2c1NX8lVlygueOrh2eyYawLW6qKEHxNhXVVUaNRO0,3637
|
|
14
|
-
chellow/utils.py,sha256=
|
|
15
|
-
chellow/views.py,sha256=
|
|
14
|
+
chellow/utils.py,sha256=dTxrY0ROMzGx1R7WJ6BzoqguLI-UGnqU6D1gyIyum88,20009
|
|
15
|
+
chellow/views.py,sha256=tufhccpENqjmGgXKcRwnMr7dUXR0PEkAJjJXM2VENEk,86101
|
|
16
16
|
chellow/e/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
chellow/e/aahedc.py,sha256=d2usudp7KYWpU6Pk3fal5EQ47EbvkvKeaFGylnb3NWw,606
|
|
18
18
|
chellow/e/bill_importer.py,sha256=mEW4s_P5tp81uf1cYWCKcr5DW1EkeRi0JUHy9caz5mI,10353
|
|
@@ -44,7 +44,7 @@ chellow/e/system_price.py,sha256=6w5J7bzwFAZubE2zdOFRiS8IIrVP8hkoIOaG2yCt-Ic,623
|
|
|
44
44
|
chellow/e/tlms.py,sha256=pyL32hPiYd09FbpXVMnBjHsWFEQHs-Az945V7EShGiY,9116
|
|
45
45
|
chellow/e/tnuos.py,sha256=NBmc-f3oezrl4gviAKobljHfICTpBKxxxEGBGJi_lRk,4927
|
|
46
46
|
chellow/e/triad.py,sha256=uQIngSrz8irBXQ0Rp_s8nAUzu-y2Ms7aj4B38_Ff8y8,13720
|
|
47
|
-
chellow/e/views.py,sha256=
|
|
47
|
+
chellow/e/views.py,sha256=jG_8QRxSg7L7S_vgvNJZ8PqGyAzaGtZEBSzOqnFy_SI,235256
|
|
48
48
|
chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=hcbjxqLOe7qkDjS7enCpmfyGwm3d-pq3u5VQIaUmVTw,3796
|
|
50
50
|
chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=yoEGQS0qcrv3TWFfxELIIi8f1CyKcIzh0xVaPoz2w2s,4191
|
|
@@ -75,33 +75,33 @@ chellow/gas/cv.py,sha256=4cdYYQ8Qak6NeYdBCB4YaQ0jX8-UkaydIIdibCQuXxM,7344
|
|
|
75
75
|
chellow/gas/dn_rate_parser.py,sha256=pmdYcqcvx8lt65Qt0dLLPi5igSET336KA0NBlNYYRTA,11378
|
|
76
76
|
chellow/gas/engine.py,sha256=d2rR1y8b3u2QhmfqyFwwLu_loeZxY_3WwwtDyGJfam0,25282
|
|
77
77
|
chellow/gas/transportation.py,sha256=uWFh0v-ViA02nH9Vof9JG3PiyAPXwhYZ1SvPxuzsQ0I,3912
|
|
78
|
-
chellow/gas/views.py,sha256=
|
|
78
|
+
chellow/gas/views.py,sha256=Yt4-T9oBDaoMHUMhR_pQhqGvX9X-kS_xABpTGisNmAY,59749
|
|
79
79
|
chellow/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
80
|
chellow/reports/report_109.py,sha256=Exb-FQ5f70-ier_h15CgHGysQ7vJ7k3gFZ1001zM3iM,11171
|
|
81
81
|
chellow/reports/report_111.py,sha256=KQk8nh7lAKw9vEf5WTjtZqYwkAAM-OBjnW7pvT0jgEY,26492
|
|
82
|
-
chellow/reports/report_169.py,sha256=
|
|
82
|
+
chellow/reports/report_169.py,sha256=OVfISpIVLO_XTHM0T1V2VHfSuLw_iNFSz9C0fPiAugM,9258
|
|
83
83
|
chellow/reports/report_181.py,sha256=ypfYWYVNC1X2fMlJyDzwNiNTTRrpPW49DirXE_xDKa0,4958
|
|
84
84
|
chellow/reports/report_183.py,sha256=fGONpKEIXTqIT_3dE5jZKBIesWPgLq-chHO6X22dIv0,8768
|
|
85
85
|
chellow/reports/report_187.py,sha256=RCvxDnkfRu7ocKUPEX0qtVphGOBEl9RULy790uteXcQ,9915
|
|
86
86
|
chellow/reports/report_219.py,sha256=3Zs16ka6dWWY_lCDoA-ZFrlPb4vHk1LQoa2yrlTMntA,7117
|
|
87
87
|
chellow/reports/report_231.py,sha256=WARLztV2HzBFSi5_xvY_DTXVyuBBbBYiU0RazfjKw-Y,5270
|
|
88
88
|
chellow/reports/report_241.py,sha256=lfivElRkV_CZAhck0rxAuhqzgponj3aWwmwGMNQvUxg,5343
|
|
89
|
-
chellow/reports/report_247.py,sha256=
|
|
89
|
+
chellow/reports/report_247.py,sha256=BWSpnqH5YhJ0NiJZYc6ZszSFTw5fKU6I-uzBAGcIPAM,43265
|
|
90
90
|
chellow/reports/report_29.py,sha256=ZXnq6Kg5on-IPquUsH4bn46mBVESY_WhwqDWZPXOJwo,2695
|
|
91
91
|
chellow/reports/report_291.py,sha256=BnWtxe0eWN2QKKWpwjs5-RI5LbReBKL119QbkrkNhV8,7478
|
|
92
92
|
chellow/reports/report_33.py,sha256=lt1EN_LNx6u-AgdaS3YRkPMZA33JgMcELolHF4oJUMw,16689
|
|
93
93
|
chellow/reports/report_387.py,sha256=bBqtnGGDWIXzXe2zVm9yeDRZKNgkUaOS3XTX6k09f18,5631
|
|
94
94
|
chellow/reports/report_41.py,sha256=8xUIN9D5dtT0Dn1RmbnWsLRmM-QbGA5xGhWCK3ljAzA,7406
|
|
95
95
|
chellow/reports/report_429.py,sha256=1LzrhfePeLg98eczzxy9HrR0EYcPYINw1LSJKk9kKAM,15812
|
|
96
|
-
chellow/reports/report_59.py,sha256=
|
|
96
|
+
chellow/reports/report_59.py,sha256=QW7yiZSnQNAmdZe_AWU2kmhd7AuyYYPqd9oL_OcXRRs,42261
|
|
97
97
|
chellow/reports/report_81.py,sha256=bBpV6MtvKGtoLiqzZoK2h21KDs4vfDwy-etpfL9oiEI,5570
|
|
98
98
|
chellow/reports/report_87.py,sha256=udzbCuXcckWD-OHmfJCT6bwg_paYhm4vfDWlL8WM-jA,6933
|
|
99
99
|
chellow/reports/report_asset_comparison.py,sha256=Cl2NgvbclqhOVvKuUu3sajTVO2JupMfzK3bV0_K8eNs,6077
|
|
100
100
|
chellow/reports/report_batches.py,sha256=MoCv2dE-JgaJzaMjMA-kZrPkYR13uDoXer5UuF12OYc,4757
|
|
101
101
|
chellow/reports/report_bills.py,sha256=LP7XDxzO0Fp10c8xDE67e4tHTEc7nN74ESQBy762Nx4,3401
|
|
102
|
-
chellow/reports/report_channel_snags.py,sha256=
|
|
102
|
+
chellow/reports/report_channel_snags.py,sha256=KjuisFEI_kF6S3ERqb6aXQC5eoKGOhBMmKb7X-DA3EI,8764
|
|
103
103
|
chellow/reports/report_csv_llfcs.py,sha256=mMB06b6Jems5kcQU4H4Le_fyKgVr8THP8BCx3pkvg5E,1903
|
|
104
|
-
chellow/reports/report_csv_site_hh_data.py,sha256=
|
|
104
|
+
chellow/reports/report_csv_site_hh_data.py,sha256=9t9LRpQLyncYnqJ-bJ3RRi9Lr_fu9S-6Qzt26E743Zw,4504
|
|
105
105
|
chellow/reports/report_csv_site_snags.py,sha256=AuAy6vjL0g7vwPPAZhBqxOyITL9_jnyFj012MnUcxxk,2627
|
|
106
106
|
chellow/reports/report_ecoes_comparison.py,sha256=ZI-wHFbWHO_MzqJ8zFZb8rJMi_O1J4ymQEoNjQ7XltQ,22784
|
|
107
107
|
chellow/reports/report_g_monthly_duration.py,sha256=aEY3hSBaCxjOBgWZYWZH38TmZEO5MpOfpOQe2Lhfpmo,18288
|
|
@@ -230,9 +230,9 @@ chellow/templates/e/dtc_meter_type.html,sha256=iqmF07NcKvepHhYA5YjK0f7zdPgBqDIAb
|
|
|
230
230
|
chellow/templates/e/dtc_meter_types.html,sha256=dTAIoaCh8DMUAHil0WQ40auLsjsni8z0MNam_2jl_VI,513
|
|
231
231
|
chellow/templates/e/duration_report.html,sha256=MrDgLDzbXdGLfpUbZ9U3xSP2H1VF0eK225LM_1U9azA,1493
|
|
232
232
|
chellow/templates/e/elexon.html,sha256=QW2EKdTMBTIzUkiXpYIHVZidZHNca3GmyiwWKaWkvIY,997
|
|
233
|
-
chellow/templates/e/em_hh_data.html,sha256=
|
|
233
|
+
chellow/templates/e/em_hh_data.html,sha256=CuSJgFnIKmrEyBSagnENIMKxFTt2QjuvocBvCCqTRVs,1964
|
|
234
234
|
chellow/templates/e/em_months.html,sha256=_WdOxiQ8dMEke1_nmD2yglY2zYzMx0AsaQgOw_6kDk8,6657
|
|
235
|
-
chellow/templates/e/em_site.html,sha256=
|
|
235
|
+
chellow/templates/e/em_site.html,sha256=CSs5_tvXrgzqJh3XuOnRRrB3_iSwQjnIvCUzLMFis_k,3528
|
|
236
236
|
chellow/templates/e/em_totals.html,sha256=pg8XmCGj-40hLCuJ3pfjNUGFteXe_xUgp7w2A5-oPtE,976
|
|
237
237
|
chellow/templates/e/energisation_status.html,sha256=hvD1qMpLYjmWWGIrv-5Ko3KbRL3a6MdQXcO3Fr4_cHA,478
|
|
238
238
|
chellow/templates/e/energisation_statuses.html,sha256=qwRIH7jqKA1MgajsWOeZAH89iRpOfsNW_fAqXymUQ3E,587
|
|
@@ -400,6 +400,6 @@ chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBe
|
|
|
400
400
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
401
401
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
402
402
|
chellow/templates/reports/channel_snags.html,sha256=_aAgFgMlTkK2HuKFU8YisAIcUYfg6Hqhgyf5MZpdK8c,2629
|
|
403
|
-
chellow-
|
|
404
|
-
chellow-
|
|
405
|
-
chellow-
|
|
403
|
+
chellow-1761645803.0.0.dist-info/METADATA,sha256=wL7joZqoQm452cQJYMcLGcmCms9GBg8WmKrHHNKNyAo,12428
|
|
404
|
+
chellow-1761645803.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
405
|
+
chellow-1761645803.0.0.dist-info/RECORD,,
|
|
File without changes
|