add logout logic and wip recap
This commit is contained in:
@@ -3,6 +3,7 @@ import jinja2
|
||||
import src.models as models
|
||||
import html
|
||||
from weasyprint import HTML
|
||||
import io
|
||||
|
||||
def generate_html_contract(
|
||||
contract: models.Contract,
|
||||
@@ -57,4 +58,25 @@ def generate_html_contract(
|
||||
return HTML(
|
||||
string=output_text,
|
||||
base_url=template_dir
|
||||
).write_pdf()
|
||||
).write_pdf()
|
||||
|
||||
from odfdo import Document, Table, Row, Cell
|
||||
|
||||
def generate_recap(
|
||||
contracts: list[models.Contract],
|
||||
form: models.Form,
|
||||
):
|
||||
data = [
|
||||
["nom", "email"],
|
||||
]
|
||||
doc = Document("spreadsheet")
|
||||
sheet = Table(name="Recap")
|
||||
sheet.set_values(data)
|
||||
|
||||
doc.body.append(sheet)
|
||||
|
||||
buffer = io.BytesIO()
|
||||
doc.save(buffer)
|
||||
|
||||
return buffer.getvalue()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user