return f'{self.header_add_form("add_free")}<textarea name="booking" rows="8" cols="80">{content}</textarea>{self.footer_add_form(start, end)}'
def add_structured(self, db, start=0, end=0, bonus_lines=10):
+ import datetime
lines = db.get_lines(start, end)
bookings, comments = parse_lines(lines)
if len(bookings) > 1:
safe_val = html.escape(str(val))
return f'<input name="{name}" value="{safe_val}" />'
if len(bookings) == 0:
- input_lines += f'{inpu("date")} {inpu("description")} ; {inpu("comment")}<br />'
+ today = str(datetime.datetime.now())[:10]
+ input_lines += f'{inpu("date", today)} {inpu("description")} ; {inpu("comment")}<br />'
last_line = 1
else:
booking = bookings[0]