From 6c45fccc53ed5344461672c412935129c8179863 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 24 Jul 2022 16:01:41 +0200 Subject: Models indentation and main database download route. --- app/main.py | 6 +++--- app/models.py | 65 +++++++++++++++++++++++++++++------------------------------ 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/app/main.py b/app/main.py index ac5625f..0f4b800 100644 --- a/app/main.py +++ b/app/main.py @@ -65,11 +65,11 @@ def home(): @main.route("/download-database") def download_database(): - return send_file("fapg.db") + return send_file("test.db") @main.route("/modules") def all_modules(): - # If unlogged, should present promotional material for available - # modules. + # If user is unlogged, should present promotional material for + # available modules. return render_template("modules-promo.html", modules=modules) diff --git a/app/models.py b/app/models.py index 009e507..480cb28 100644 --- a/app/models.py +++ b/app/models.py @@ -115,22 +115,22 @@ class Customer(db.Model): orders = db.relationship("Order", back_populates="customer") def __init__( - self, - name, - name_alternative, - code_customer, - code_accounting, - address, - postal_code, - city, - country, - phone, - website, - email, - professional_id_1, - professional_id_2, - tax_id, - payment_terms, + self, + name, + name_alternative, + code_customer, + code_accounting, + address, + postal_code, + city, + country, + phone, + website, + email, + professional_id_1, + professional_id_2, + tax_id, + payment_terms, ): self.name = name self.name_alternative = name_alternative @@ -176,15 +176,15 @@ class Invoice(db.Model): orders = db.relationship("Order", back_populates="invoice") def __init__( - self, - invoice_id_alt, - customer_id, - customer_reference, - date_billed, - date_due, - amount_net, - amount_gross, - amount_tax, + self, + invoice_id_alt, + customer_id, + customer_reference, + date_billed, + date_due, + amount_net, + amount_gross, + amount_tax, ): self.invoice_id_alt = invoice_id_alt self.customer_id = customer_id @@ -257,13 +257,13 @@ class Product(db.Model): orders = db.relationship("Order", back_populates="product") def __init__( - self, - name, - code_accounting, - unit_weight, - price_net, - price_gross, - tax_rate, + self, + name, + code_accounting, + unit_weight, + price_net, + price_gross, + tax_rate, ): self.name = name self.code_accounting = code_accounting @@ -303,7 +303,6 @@ class FertiLog(db.Model): ) targets = db.relationship("FertiTarget", back_populates="ferti_log") - def __init__(self, nno3, p, k, ca, mg, s, na, cl, fe, zn, b, mn, cu, mo, si, nnh4): self.nno3 = nno3 self.p = p -- cgit v1.2.3