to_delete += [target]
i = 0
if 'eatable_uuid' in postvars.keys():
- for uuid_encoded in postvars['eatable_uuid']:
- uuid = uuid_encoded
+ for uuid in postvars['eatable_uuid']:
if uuid not in to_delete:
e = Eatable(decode("title", i, False), decode("cals", i), decode("sugar_g", i), decode("standard_g", i), decode("comments", i, False))
db.add_eatable(uuid, e)
start = end = 0
desc = head_comment = ''
if len(bookings) == 0:
- for i in range(1, 3):
+ for i in range(1, 8):
booking_lines += [{'i': i, 'acc': '', 'amt': '', 'curr': '€', 'comment': ''}]
date=today
else:
parsed_url = urlparse(self.path)
length = int(self.headers['content-length'])
postvars = parse_qs(self.rfile.read(length).decode(), keep_blank_values=1)
+ print("DEBUG", postvars['start'], postvars['end'])
start = int(postvars['start'][0])
end = int(postvars['end'][0])
db = LedgerDB(prefix)
# otherwise just re-build editing form
else:
if prefix + '/add_structured' == parsed_url.path:
- edit_content = db.add_structured(db, start, end, temp_lines=lines, add_empty_line=add_empty_line)
+ edit_content = db.add_structured(start, end, temp_lines=lines, add_empty_line=add_empty_line)
else:
- edit_content = db.add_free(db, start, end)
- self.send_HTML(edit_content)
+ edit_content = db.add_free(start, end)
+ header = jinja2.Template(html_head).render(prefix=prefix)
+ self.send_HTML(header + edit_content)
except PlomException as e:
self.fail_400(e)
else:
page = db.ledger_as_html()
header = jinja2.Template(html_head).render(prefix=prefix)
- self.send_HTML(header+ page)
+ self.send_HTML(header + page)
except PlomException as e:
self.fail_400(e)