chellow 1733390302.0.0__py3-none-any.whl → 1734005435.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/__init__.py +0 -1
- chellow/e/bill_parsers/mm.py +27 -5
- chellow/e/computer.py +1 -7
- chellow/e/views.py +126 -10
- chellow/gas/engine.py +1 -3
- chellow/gas/views.py +3 -2
- chellow/reports/report_109.py +2 -3
- chellow/reports/report_111.py +2 -3
- chellow/reports/report_169.py +2 -3
- chellow/reports/report_181.py +2 -3
- chellow/reports/report_183.py +3 -4
- chellow/reports/report_187.py +2 -3
- chellow/reports/report_219.py +2 -3
- chellow/reports/report_231.py +2 -3
- chellow/reports/report_233.py +2 -3
- chellow/reports/report_241.py +2 -3
- chellow/reports/report_247.py +2 -3
- chellow/reports/report_29.py +2 -3
- chellow/reports/report_291.py +2 -3
- chellow/reports/report_33.py +2 -3
- chellow/reports/report_387.py +2 -3
- chellow/reports/report_41.py +2 -3
- chellow/reports/report_429.py +2 -3
- chellow/reports/report_59.py +2 -3
- chellow/reports/report_81.py +2 -3
- chellow/reports/report_87.py +3 -7
- chellow/reports/report_asset_comparison.py +2 -3
- chellow/reports/report_batches.py +2 -3
- chellow/reports/report_bills.py +4 -3
- chellow/reports/report_csv_llfcs.py +2 -3
- chellow/reports/report_csv_site_hh_data.py +2 -3
- chellow/reports/report_csv_site_snags.py +2 -3
- chellow/reports/report_ecoes_comparison.py +2 -3
- chellow/reports/report_g_monthly_duration.py +2 -3
- chellow/reports/report_g_supplies_snapshot.py +2 -3
- chellow/reports/report_g_supply_virtual_bill.py +2 -3
- chellow/reports/report_g_virtual_bills.py +2 -3
- chellow/reports/report_g_virtual_bills_hh.py +2 -3
- chellow/reports/report_sscs.py +2 -3
- chellow/reports/report_supply_contacts.py +2 -3
- chellow/templates/e/dc_contract_properties_edit.html +10 -10
- chellow/templates/e/site_hh_data.html +73 -49
- chellow/templates/site.html +1 -1
- chellow/utils.py +0 -2
- chellow/views.py +33 -167
- {chellow-1733390302.0.0.dist-info → chellow-1734005435.0.0.dist-info}/METADATA +1 -1
- {chellow-1733390302.0.0.dist-info → chellow-1734005435.0.0.dist-info}/RECORD +48 -49
- chellow/templates/site_hh_data.html +0 -75
- {chellow-1733390302.0.0.dist-info → chellow-1734005435.0.0.dist-info}/WHEEL +0 -0
chellow/reports/report_41.py
CHANGED
|
@@ -4,7 +4,7 @@ import threading
|
|
|
4
4
|
import traceback
|
|
5
5
|
from datetime import datetime as Datetime
|
|
6
6
|
|
|
7
|
-
from flask import g, request
|
|
7
|
+
from flask import g, redirect, request
|
|
8
8
|
|
|
9
9
|
from sqlalchemy import or_
|
|
10
10
|
from sqlalchemy.sql.expression import null, true
|
|
@@ -23,7 +23,6 @@ from chellow.utils import (
|
|
|
23
23
|
req_int,
|
|
24
24
|
to_utc,
|
|
25
25
|
)
|
|
26
|
-
from chellow.views import chellow_redirect
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
def _make_eras(sess, nov_start, year_finish, supply_id):
|
|
@@ -211,4 +210,4 @@ def do_get(sess):
|
|
|
211
210
|
year = req_int("year")
|
|
212
211
|
supply_id = req_int("supply_id") if "supply_id" in request.values else None
|
|
213
212
|
threading.Thread(target=content, args=(year, supply_id, g.user.id)).start()
|
|
214
|
-
return
|
|
213
|
+
return redirect("/downloads", 303)
|
chellow/reports/report_429.py
CHANGED
|
@@ -7,7 +7,7 @@ from datetime import datetime as Datetime
|
|
|
7
7
|
from decimal import Decimal
|
|
8
8
|
from itertools import combinations
|
|
9
9
|
|
|
10
|
-
from flask import g, request
|
|
10
|
+
from flask import g, redirect, request
|
|
11
11
|
|
|
12
12
|
from sqlalchemy import null, or_, select, true
|
|
13
13
|
from sqlalchemy.orm import joinedload
|
|
@@ -18,7 +18,6 @@ import chellow.gas.engine
|
|
|
18
18
|
from chellow.dloads import open_file
|
|
19
19
|
from chellow.models import GBatch, GBill, GContract, GEra, Session, Site, SiteGEra, User
|
|
20
20
|
from chellow.utils import csv_make_val, hh_max, hh_min, req_date, req_int, to_utc
|
|
21
|
-
from chellow.views import chellow_redirect
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
def content(g_batch_id, g_bill_id, g_contract_id, start_date, finish_date, user_id):
|
|
@@ -361,4 +360,4 @@ def do_get(sess):
|
|
|
361
360
|
|
|
362
361
|
args = g_batch_id, g_bill_id, g_contract_id, start_date, finish_date, g.user.id
|
|
363
362
|
threading.Thread(target=content, args=args).start()
|
|
364
|
-
return
|
|
363
|
+
return redirect("/downloads", 303)
|
chellow/reports/report_59.py
CHANGED
|
@@ -5,7 +5,7 @@ from collections import defaultdict
|
|
|
5
5
|
|
|
6
6
|
from dateutil.relativedelta import relativedelta
|
|
7
7
|
|
|
8
|
-
from flask import flash, g, make_response, render_template, request
|
|
8
|
+
from flask import flash, g, make_response, redirect, render_template, request
|
|
9
9
|
|
|
10
10
|
import odio
|
|
11
11
|
|
|
@@ -50,7 +50,6 @@ from chellow.utils import (
|
|
|
50
50
|
to_utc,
|
|
51
51
|
utc_datetime_now,
|
|
52
52
|
)
|
|
53
|
-
from chellow.views import chellow_redirect
|
|
54
53
|
|
|
55
54
|
|
|
56
55
|
CATEGORY_ORDER = {None: 0, "unmetered": 1, "nhh": 2, "amr": 3, "hh": 4}
|
|
@@ -1072,7 +1071,7 @@ def do_post(sess):
|
|
|
1072
1071
|
sess.rollback()
|
|
1073
1072
|
thread = threading.Thread(target=content, args=args)
|
|
1074
1073
|
thread.start()
|
|
1075
|
-
return
|
|
1074
|
+
return redirect("/downloads", 303)
|
|
1076
1075
|
except BadRequest as e:
|
|
1077
1076
|
flash(e.description)
|
|
1078
1077
|
if "scenario_id" in request.values:
|
chellow/reports/report_81.py
CHANGED
|
@@ -2,7 +2,7 @@ import csv
|
|
|
2
2
|
import threading
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
|
-
from flask import g
|
|
5
|
+
from flask import g, redirect
|
|
6
6
|
|
|
7
7
|
from sqlalchemy import or_
|
|
8
8
|
from sqlalchemy.orm import joinedload
|
|
@@ -14,7 +14,6 @@ from chellow.dloads import open_file
|
|
|
14
14
|
from chellow.e.computer import SupplySource, contract_func, forecast_date
|
|
15
15
|
from chellow.models import Contract, Era, RSession, User
|
|
16
16
|
from chellow.utils import c_months_u, csv_make_val, hh_format, hh_max, hh_min, req_int
|
|
17
|
-
from chellow.views import chellow_redirect
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
def content(user_id, contract_id, end_year, end_month, months):
|
|
@@ -147,4 +146,4 @@ def do_get(sess):
|
|
|
147
146
|
|
|
148
147
|
args = g.user.id, contract_id, end_year, end_month, months
|
|
149
148
|
threading.Thread(target=content, args=args).start()
|
|
150
|
-
return
|
|
149
|
+
return redirect("/downloads", 303)
|
chellow/reports/report_87.py
CHANGED
|
@@ -2,7 +2,7 @@ import csv
|
|
|
2
2
|
import threading
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
|
-
from flask import g
|
|
5
|
+
from flask import g, redirect
|
|
6
6
|
|
|
7
7
|
from sqlalchemy import or_, select
|
|
8
8
|
from sqlalchemy.sql.expression import null, true
|
|
@@ -32,7 +32,6 @@ from chellow.utils import (
|
|
|
32
32
|
req_int,
|
|
33
33
|
to_ct,
|
|
34
34
|
)
|
|
35
|
-
from chellow.views import chellow_redirect
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
def _process_era(
|
|
@@ -202,10 +201,7 @@ def create_csv(f, sess, start_date, finish_date, contract_id):
|
|
|
202
201
|
)
|
|
203
202
|
writer.writerow(csv_make_val(vals.get(t)) for t in titles)
|
|
204
203
|
except BadRequest as e:
|
|
205
|
-
raise BadRequest(
|
|
206
|
-
f"Problem with {chellow.utils.url_root}eras/{era.id}/edit "
|
|
207
|
-
f"{e.description}"
|
|
208
|
-
)
|
|
204
|
+
raise BadRequest(f"Problem with /e/eras/{era.id}/edit {e.description}")
|
|
209
205
|
|
|
210
206
|
sess.rollback() # Avoid long-running transaction
|
|
211
207
|
|
|
@@ -243,4 +239,4 @@ def do_get(sess):
|
|
|
243
239
|
threading.Thread(
|
|
244
240
|
target=content, args=(start_date, finish_date, contract_id, g.user.id)
|
|
245
241
|
).start()
|
|
246
|
-
return
|
|
242
|
+
return redirect("/downloads", 303)
|
|
@@ -4,7 +4,7 @@ import threading
|
|
|
4
4
|
import traceback
|
|
5
5
|
from io import StringIO
|
|
6
6
|
|
|
7
|
-
from flask import g, request
|
|
7
|
+
from flask import g, redirect, request
|
|
8
8
|
|
|
9
9
|
from sqlalchemy import select
|
|
10
10
|
from sqlalchemy.orm import joinedload
|
|
@@ -14,7 +14,6 @@ from werkzeug.exceptions import BadRequest
|
|
|
14
14
|
|
|
15
15
|
from chellow.dloads import open_file
|
|
16
16
|
from chellow.models import Contract, Era, ReportRun, Session, Site, SiteEra, User
|
|
17
|
-
from chellow.views import chellow_redirect
|
|
18
17
|
|
|
19
18
|
STATUSES_ACTIVE = ("IN USE / IN SERVICE", "STORED SPARE")
|
|
20
19
|
STATUSES_INACTIVE = ("DEMOLISHED", "SOLD", "ABANDONED")
|
|
@@ -194,4 +193,4 @@ def do_post(sess):
|
|
|
194
193
|
sess.commit()
|
|
195
194
|
args = user.id, StringIO(file_item.read().decode("utf8")), report_run.id
|
|
196
195
|
threading.Thread(target=content, args=args).start()
|
|
197
|
-
return
|
|
196
|
+
return redirect(f"/report_runs/{report_run.id}", 303)
|
|
@@ -2,7 +2,7 @@ import csv
|
|
|
2
2
|
import threading
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
|
-
from flask import g
|
|
5
|
+
from flask import g, redirect
|
|
6
6
|
|
|
7
7
|
from sqlalchemy.sql import func, select
|
|
8
8
|
|
|
@@ -16,7 +16,6 @@ from chellow.models import (
|
|
|
16
16
|
User,
|
|
17
17
|
)
|
|
18
18
|
from chellow.utils import csv_make_val
|
|
19
|
-
from chellow.views import chellow_redirect
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
def content(user_id):
|
|
@@ -142,4 +141,4 @@ def content(user_id):
|
|
|
142
141
|
|
|
143
142
|
def do_get(sess):
|
|
144
143
|
threading.Thread(target=content, args=(g.user.id,)).start()
|
|
145
|
-
return
|
|
144
|
+
return redirect("/downloads", 303)
|
chellow/reports/report_bills.py
CHANGED
|
@@ -3,7 +3,7 @@ import threading
|
|
|
3
3
|
import traceback
|
|
4
4
|
from collections import defaultdict
|
|
5
5
|
|
|
6
|
-
from flask import g
|
|
6
|
+
from flask import g, redirect
|
|
7
7
|
|
|
8
8
|
from sqlalchemy import select
|
|
9
9
|
from sqlalchemy.orm import joinedload
|
|
@@ -11,7 +11,6 @@ from sqlalchemy.orm import joinedload
|
|
|
11
11
|
from chellow.dloads import open_file
|
|
12
12
|
from chellow.models import Batch, Bill, Session, User
|
|
13
13
|
from chellow.utils import csv_make_val, req_int
|
|
14
|
-
from chellow.views import chellow_redirect
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
def _content(sess, writer, batch_id):
|
|
@@ -36,6 +35,7 @@ def _content(sess, writer, batch_id):
|
|
|
36
35
|
"vat_2_percent",
|
|
37
36
|
"vat_2_net",
|
|
38
37
|
"vat_2_vat",
|
|
38
|
+
"breakdown",
|
|
39
39
|
]
|
|
40
40
|
writer.writerow(titles)
|
|
41
41
|
|
|
@@ -79,6 +79,7 @@ def _content(sess, writer, batch_id):
|
|
|
79
79
|
"vat_2_percent": None,
|
|
80
80
|
"vat_2_net": None,
|
|
81
81
|
"vat_2_vat": None,
|
|
82
|
+
"breakdown": bill.breakdown,
|
|
82
83
|
}
|
|
83
84
|
for i, (percentage, vbd) in enumerate(sorted(vat_breakdown.items()), 1):
|
|
84
85
|
vals[f"vat_{i}_percentage"] = percentage
|
|
@@ -111,4 +112,4 @@ def do_get(sess):
|
|
|
111
112
|
batch_id = req_int("batch_id")
|
|
112
113
|
args = g.user.id, batch_id
|
|
113
114
|
threading.Thread(target=content, args=args).start()
|
|
114
|
-
return
|
|
115
|
+
return redirect("/downloads", 303)
|
|
@@ -2,14 +2,13 @@ import csv
|
|
|
2
2
|
import threading
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
|
-
from flask import g
|
|
5
|
+
from flask import g, redirect
|
|
6
6
|
|
|
7
7
|
from sqlalchemy.orm import joinedload
|
|
8
8
|
|
|
9
9
|
from chellow.dloads import open_file
|
|
10
10
|
from chellow.models import Llfc, Session, User
|
|
11
11
|
from chellow.utils import hh_format
|
|
12
|
-
from chellow.views import chellow_redirect
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
def content(user_id):
|
|
@@ -64,4 +63,4 @@ def content(user_id):
|
|
|
64
63
|
def do_get(sess):
|
|
65
64
|
args = (g.user.id,)
|
|
66
65
|
threading.Thread(target=content, args=args).start()
|
|
67
|
-
return
|
|
66
|
+
return redirect("/downloads", 303)
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import threading
|
|
4
4
|
import traceback
|
|
5
5
|
|
|
6
|
-
from flask import g, request
|
|
6
|
+
from flask import g, redirect, request
|
|
7
7
|
|
|
8
8
|
from sqlalchemy import null, or_, select, true
|
|
9
9
|
from sqlalchemy.orm import joinedload
|
|
@@ -11,7 +11,6 @@ from sqlalchemy.orm import joinedload
|
|
|
11
11
|
from chellow.dloads import open_file
|
|
12
12
|
from chellow.models import Era, Session, Site, SiteEra, Source, Supply, User
|
|
13
13
|
from chellow.utils import req_date, req_int, write_row
|
|
14
|
-
from chellow.views import chellow_redirect
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
TYPE_ORDER = {"hh": 0, "amr": 1, "nhh": 2, "unmetered": 3}
|
|
@@ -122,4 +121,4 @@ def do_get(sess):
|
|
|
122
121
|
|
|
123
122
|
args = start_date, finish_date, site_id, g.user.id
|
|
124
123
|
threading.Thread(target=content, args=args).start()
|
|
125
|
-
return
|
|
124
|
+
return redirect("/downloads", 303)
|
|
@@ -3,7 +3,7 @@ import threading
|
|
|
3
3
|
import traceback
|
|
4
4
|
from datetime import datetime as Datetime, timedelta as Timedelta
|
|
5
5
|
|
|
6
|
-
from flask import g
|
|
6
|
+
from flask import g, redirect
|
|
7
7
|
|
|
8
8
|
import pytz
|
|
9
9
|
|
|
@@ -13,7 +13,6 @@ from sqlalchemy.sql.expression import null
|
|
|
13
13
|
from chellow.dloads import open_file
|
|
14
14
|
from chellow.models import Session, Site, Snag, User
|
|
15
15
|
from chellow.utils import hh_format
|
|
16
|
-
from chellow.views import chellow_redirect
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
def content(user_id):
|
|
@@ -81,4 +80,4 @@ def content(user_id):
|
|
|
81
80
|
def do_get(sess):
|
|
82
81
|
args = (g.user.id,)
|
|
83
82
|
threading.Thread(target=content, args=args).start()
|
|
84
|
-
return
|
|
83
|
+
return redirect("/downloads", 303)
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import threading
|
|
4
4
|
import traceback
|
|
5
5
|
|
|
6
|
-
from flask import g
|
|
6
|
+
from flask import g, redirect
|
|
7
7
|
|
|
8
8
|
import requests
|
|
9
9
|
|
|
@@ -26,7 +26,6 @@ from chellow.models import (
|
|
|
26
26
|
User,
|
|
27
27
|
)
|
|
28
28
|
from chellow.utils import csv_make_val, req_bool
|
|
29
|
-
from chellow.views import chellow_redirect
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
FNAME = "ecoes_comparison"
|
|
@@ -615,4 +614,4 @@ def do_get(sess):
|
|
|
615
614
|
sess.commit()
|
|
616
615
|
args = g.user.id, show_ignored, report_run.id
|
|
617
616
|
threading.Thread(target=content, args=args).start()
|
|
618
|
-
return
|
|
617
|
+
return redirect(f"/report_runs/{report_run.id}", 303)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import threading
|
|
2
2
|
import traceback
|
|
3
3
|
|
|
4
|
-
from flask import g, request
|
|
4
|
+
from flask import g, redirect, request
|
|
5
5
|
|
|
6
6
|
import odio
|
|
7
7
|
|
|
@@ -42,7 +42,6 @@ from chellow.utils import (
|
|
|
42
42
|
to_utc,
|
|
43
43
|
utc_datetime_now,
|
|
44
44
|
)
|
|
45
|
-
from chellow.views import chellow_redirect
|
|
46
45
|
|
|
47
46
|
|
|
48
47
|
def write_spreadsheet(fl, compressed, site_rows, era_rows):
|
|
@@ -535,4 +534,4 @@ def do_get(sess):
|
|
|
535
534
|
args = scenario_props, g.user.id, compression, now, base_name
|
|
536
535
|
|
|
537
536
|
threading.Thread(target=content, args=args).start()
|
|
538
|
-
return
|
|
537
|
+
return redirect("/downloads", 303)
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import threading
|
|
4
4
|
import traceback
|
|
5
5
|
|
|
6
|
-
from flask import g, request
|
|
6
|
+
from flask import g, redirect, request
|
|
7
7
|
|
|
8
8
|
from sqlalchemy import or_
|
|
9
9
|
from sqlalchemy.orm import joinedload
|
|
@@ -16,7 +16,6 @@ from chellow.e.computer import contract_func
|
|
|
16
16
|
from chellow.gas.engine import GDataSource, forecast_date
|
|
17
17
|
from chellow.models import GEra, GSupply, Session
|
|
18
18
|
from chellow.utils import csv_make_val, req_date, req_int
|
|
19
|
-
from chellow.views import chellow_redirect
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
def content(date, g_supply_id, user):
|
|
@@ -136,4 +135,4 @@ def do_get(session):
|
|
|
136
135
|
|
|
137
136
|
args = (date, g_supply_id, user)
|
|
138
137
|
threading.Thread(target=content, args=args).start()
|
|
139
|
-
return
|
|
138
|
+
return redirect("/downloads", 303)
|
|
@@ -2,7 +2,7 @@ import csv
|
|
|
2
2
|
import threading
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
|
-
from flask import g
|
|
5
|
+
from flask import g, redirect
|
|
6
6
|
|
|
7
7
|
from sqlalchemy import or_
|
|
8
8
|
from sqlalchemy.sql.expression import null, true
|
|
@@ -14,7 +14,6 @@ from chellow.e.computer import forecast_date
|
|
|
14
14
|
from chellow.gas.engine import GDataSource, g_contract_func
|
|
15
15
|
from chellow.models import GEra, GSupply, Session, Site, SiteGEra
|
|
16
16
|
from chellow.utils import csv_make_val, hh_format, hh_max, hh_min, req_date, req_int
|
|
17
|
-
from chellow.views import chellow_redirect
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
def content(g_supply_id, file_name, start_date, finish_date, user):
|
|
@@ -107,4 +106,4 @@ def do_get(sess):
|
|
|
107
106
|
args = (g_supply_id, file_name, start_date, finish_date, g.user)
|
|
108
107
|
|
|
109
108
|
threading.Thread(target=content, args=args).start()
|
|
110
|
-
return
|
|
109
|
+
return redirect("/downloads", 303)
|
|
@@ -4,7 +4,7 @@ import threading
|
|
|
4
4
|
import traceback
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
from flask import g
|
|
7
|
+
from flask import g, redirect
|
|
8
8
|
|
|
9
9
|
from sqlalchemy import or_
|
|
10
10
|
from sqlalchemy.sql.expression import null, true
|
|
@@ -25,7 +25,6 @@ from chellow.utils import (
|
|
|
25
25
|
req_int,
|
|
26
26
|
to_ct,
|
|
27
27
|
)
|
|
28
|
-
from chellow.views import chellow_redirect
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
def content(start_date, finish_date, g_contract_id, user_id):
|
|
@@ -137,4 +136,4 @@ def do_get(sess):
|
|
|
137
136
|
|
|
138
137
|
args = start_date, finish_date, g_contract_id, g.user.id
|
|
139
138
|
threading.Thread(target=content, args=args).start()
|
|
140
|
-
return
|
|
139
|
+
return redirect("/downloads", 303)
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import threading
|
|
4
4
|
import traceback
|
|
5
5
|
|
|
6
|
-
from flask import g
|
|
6
|
+
from flask import g, redirect
|
|
7
7
|
|
|
8
8
|
from sqlalchemy import or_
|
|
9
9
|
from sqlalchemy.sql.expression import null, true
|
|
@@ -14,7 +14,6 @@ from chellow.e.computer import contract_func
|
|
|
14
14
|
from chellow.gas.engine import GDataSource
|
|
15
15
|
from chellow.models import GEra, GSupply, Session, Site, SiteGEra
|
|
16
16
|
from chellow.utils import csv_make_val, hh_format, hh_range, req_date, req_int
|
|
17
|
-
from chellow.views import chellow_redirect
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
def content(g_supply_id, start_date, finish_date, user):
|
|
@@ -105,4 +104,4 @@ def do_get(sess):
|
|
|
105
104
|
|
|
106
105
|
args = g_supply_id, start_date, finish_date, g.user
|
|
107
106
|
threading.Thread(target=content, args=args).start()
|
|
108
|
-
return
|
|
107
|
+
return redirect("/downloads", 303)
|
chellow/reports/report_sscs.py
CHANGED
|
@@ -3,7 +3,7 @@ import threading
|
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
from flask import g, request
|
|
6
|
+
from flask import g, redirect, request
|
|
7
7
|
|
|
8
8
|
import odio
|
|
9
9
|
|
|
@@ -15,7 +15,6 @@ from werkzeug.exceptions import BadRequest
|
|
|
15
15
|
from chellow.dloads import open_file
|
|
16
16
|
from chellow.models import MeasurementRequirement, Session, Ssc, Tpr, User
|
|
17
17
|
from chellow.utils import req_bool
|
|
18
|
-
from chellow.views import chellow_redirect
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
def write_spreadsheet(
|
|
@@ -114,4 +113,4 @@ def do_get(sess):
|
|
|
114
113
|
|
|
115
114
|
args = (user.id, compression)
|
|
116
115
|
threading.Thread(target=content, args=args).start()
|
|
117
|
-
return
|
|
116
|
+
return redirect("/downloads", 303)
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
import threading
|
|
4
4
|
import traceback
|
|
5
5
|
|
|
6
|
-
from flask import g
|
|
6
|
+
from flask import g, redirect
|
|
7
7
|
|
|
8
8
|
from sqlalchemy import select
|
|
9
9
|
from sqlalchemy.orm import joinedload
|
|
@@ -21,7 +21,6 @@ from chellow.models import (
|
|
|
21
21
|
Supply,
|
|
22
22
|
User,
|
|
23
23
|
)
|
|
24
|
-
from chellow.views import chellow_redirect
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
FNAME = "supply_contacts"
|
|
@@ -127,4 +126,4 @@ def do_get(sess):
|
|
|
127
126
|
report_run = ReportRun.insert(sess, FNAME, g.user, FNAME, {})
|
|
128
127
|
sess.commit()
|
|
129
128
|
threading.Thread(target=content, args=(g.user.id, report_run.id)).start()
|
|
130
|
-
return
|
|
129
|
+
return redirect(f"/report_runs/{report_run.id}", 303)
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"private_key": "private_key", /* Remove if using password */
|
|
40
40
|
"directories": ["downloads1", "downloads2"],
|
|
41
41
|
"mpan_map": { /* Optional */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
"99 0993 2821 985": {
|
|
43
|
+
"mpan": null, /* Ignore MPAN */
|
|
44
|
+
"from": 2024-12-04T10:00:00Z,
|
|
45
45
|
"to": 2025-01-12:00:00Z,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
},
|
|
47
|
+
"99 0873 1942 952": {
|
|
48
|
+
"mpan": "99 7821 8541 389",
|
|
49
|
+
"from": 2024-11-16T22:00:00Z,
|
|
50
|
+
"to": 2025-02-18:00:00Z,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
53
|
}
|
|
54
54
|
</pre>
|
|
55
55
|
</code>
|
|
@@ -1,52 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}
|
|
4
|
+
Sites » {{site.code}} {{site.name}} » HH data
|
|
5
|
+
{% endblock %}
|
|
6
|
+
|
|
7
|
+
{% block inside_head %}
|
|
8
|
+
<style>
|
|
9
|
+
tbody > tr {
|
|
10
|
+
scroll-margin-top: 8em;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
tbody > tr:target {
|
|
14
|
+
background-color: yellow;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
{% endblock %}
|
|
18
|
+
|
|
19
|
+
{% block nav %}
|
|
20
|
+
<a href="/sites">Sites</a> »
|
|
21
|
+
<a href="/sites/{{site.id}}">{{site.code}} {{site.name}}</a> » HH data
|
|
22
|
+
{% endblock %}
|
|
23
|
+
|
|
24
|
+
{% block content %}
|
|
25
|
+
<form action="/e/sites/{{site.id}}/hh_data">
|
|
26
|
+
<fieldset>
|
|
27
|
+
<label>Month</label> {{input_date(prefix='start', initial=start_date, resolution='month')}}
|
|
28
|
+
<input type="submit" value="Show">
|
|
29
|
+
</fieldset>
|
|
30
|
+
</form>
|
|
31
|
+
|
|
32
|
+
<table class="sticky">
|
|
33
|
+
<caption>HH Data</caption>
|
|
34
|
+
<thead>
|
|
34
35
|
<tr>
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
{% for
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
<
|
|
36
|
+
<th>HH Starting</th>
|
|
37
|
+
<th>Imported kWh</th>
|
|
38
|
+
<th>Used kWh</th>
|
|
39
|
+
<th>Displaced kWh</th>
|
|
40
|
+
<th>Generated kWh</th>
|
|
41
|
+
<th>Exported kWh</th>
|
|
42
|
+
<th>Parasitic kWh</th>
|
|
43
|
+
{% for supply in supplies %}
|
|
44
|
+
{% set pref = supply.name + ' '+ supply.source.code +
|
|
45
|
+
(' ' + supply.generator_type.code if
|
|
46
|
+
supply.generator_type != None else '') %}
|
|
47
|
+
<th style="border-left-width: medium;">{{pref}} Imp kWh</th>
|
|
48
|
+
<th>{{pref}} Imp Status</th>
|
|
49
|
+
<th>{{pref}} Exp kWh</th>
|
|
50
|
+
<th>{{pref}} Exp Status</th>
|
|
48
51
|
{% endfor %}
|
|
49
52
|
</tr>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
</thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
{% for hh in hh_data %}
|
|
56
|
+
{% set start_str = hh.start_date|hh_format %}
|
|
57
|
+
<tr id="{{start_str}}">
|
|
58
|
+
<td style="white-space: nowrap">{{start_str}}</td>
|
|
59
|
+
<td>{{hh.import_kwh}}</td>
|
|
60
|
+
<td>{{hh.used_kwh}}</td>
|
|
61
|
+
<td>{{hh.displaced_kwh}}</td>
|
|
62
|
+
<td>{{hh.generated_kwh}}</td>
|
|
63
|
+
<td>{{hh.export_kwh}}</td>
|
|
64
|
+
<td>{{hh.parasitic_kwh}}</td>
|
|
65
|
+
{% for datum in hh.supplies %}
|
|
66
|
+
<td style="border-left-width: medium;"
|
|
67
|
+
>{{datum.import_kwh}}</td>
|
|
68
|
+
<td>{{datum.import_status}}</td>
|
|
69
|
+
<td>{{datum.export_kwh}}</td>
|
|
70
|
+
<td>{{datum.export_status}}</td>
|
|
71
|
+
{% endfor %}
|
|
72
|
+
</tr>
|
|
73
|
+
{% endfor %}
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
{% endblock %}
|
chellow/templates/site.html
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
Table of site level monthly kWh, MD kWh etc.</a>
|
|
162
162
|
</li>
|
|
163
163
|
<li>
|
|
164
|
-
<a href="/sites/{{site.id}}/hh_data?
|
|
164
|
+
<a href="/e/sites/{{site.id}}/hh_data?start_year={{month_finish.year}}&start_month={{month_finish.month}}">Table of hh data</a>
|
|
165
165
|
</li>
|
|
166
166
|
<li>
|
|
167
167
|
<a href="/e/sites/{{site.id}}/site_snags">Site Snags</a>
|