summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2022-07-24 16:01:41 +0200
committerMarius Peter <marius.peter@tutanota.com>2022-07-24 16:01:41 +0200
commit6c45fccc53ed5344461672c412935129c8179863 (patch)
tree8727217e9099014d652be404796b3f6141bea0f0
parent18a64c63920bdaba1b8348493b8e7eb1cdc81294 (diff)
Models indentation and main database download route.
-rw-r--r--app/main.py6
-rw-r--r--app/models.py65
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
Copyright 2019--2024 Marius PETER