From e20fa526e646494721f6d8e776455cf67820fb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ho=CC=88rler?= Date: Sun, 18 Feb 2018 17:55:20 +0100 Subject: [PATCH 1/3] change Organigram --- docs/doku.org | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/doku.org b/docs/doku.org index 1a54d71..f8ca5b5 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -340,30 +340,33 @@ Am ende des Projekts die nicht lauffähigen teile ausgrenzen. :-) #+NAME: fig:Organigram #+BEGIN_EXPORT latex \begin{tikzpicture}[ - auto, node distance = 0.4cm, + auto, + node distance = 0.4cm, thick, - every node/.style = { + every node/.style = { rectangle, font = \sffamily, white, - top color = green!90!black, + top color = green!90!black, bottom color = green!60!black, - text width = 2.7cm, + text width = 2.4cm, align = center, minimum height = 1cm } ] - \node (PL) {\textbf{PL}\\Projektleiter}; - \coordinate [below = 0.2cm of PL] (Unten); - \node (FD) [below = of PL] {\textbf{FD}\\Frontenddeveloper}; - \node (SE) [left = of FD] {\textbf{SE}\\Softwareengineer}; - \node (BD) [right = of FD] {\textbf{BD}\\Backenddeveloper}; - \draw [green!60!black,thick] - (PL) -- (Unten) -| (FD) - (Unten) -| (SE) - (Unten) -| (BD); - \end{tikzpicture} - #+END_EXPORT + \node (CH) {\textbf{CH}\\Christian Herren}; + \coordinate [below = 0.9cm of CH] (Mitte); + \coordinate [below = 1.6cm of CH] (Unten); + \node (CV) [right = 2mm of Mitte] {\textbf{CV}\\Christian Vögeli}; + \node (AZ) [below = of CV] {\textbf{AZ}\\Andreas Zweili}; + \node (IH) [left = of AZ] {\textbf{IH}\\Ivan Hörler}; + \draw [green!60!black,thick] + (CH) -- (Mitte) + (CV) -- (Mitte) -- (Unten) -| (IH) + (Unten) -| (IH) + (Unten) -| (AZ); +\end{tikzpicture} + #+END_EXPORT ** Projektstrukturplan ** Varianten From 16ce980215fcd7a574c1e4c1e24552f355f6ea08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ho=CC=88rler?= Date: Sun, 18 Feb 2018 19:28:39 +0100 Subject: [PATCH 2/3] unfinished form for andreas --- django/didgeridoo/webshop/forms.py | 4 ++-- django/didgeridoo/webshop/views.py | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/django/didgeridoo/webshop/forms.py b/django/didgeridoo/webshop/forms.py index 6fe79f7..08e7beb 100644 --- a/django/didgeridoo/webshop/forms.py +++ b/django/didgeridoo/webshop/forms.py @@ -69,9 +69,9 @@ class AddToCartForm(forms.Form): class CartForm(forms.Form): print('CartForm') - def ChangeAmount(self): + def ChangeAmount(self, _article_id): print('CartForm.ChangeAmount') - article = OrderPosition.objects.filter(pk=self.id) + article = OrderPosition.objects.filter(pk=_article_id) amountfield = forms.IntegerField( label='pce', help_text='Enter a Value between 1 and 99.', diff --git a/django/didgeridoo/webshop/views.py b/django/didgeridoo/webshop/views.py index 684ef5a..9607e87 100644 --- a/django/didgeridoo/webshop/views.py +++ b/django/didgeridoo/webshop/views.py @@ -197,7 +197,6 @@ def cart(request): article_view = True currency_name = "CHF" message = "" - cart_id = False articles_list = "" prices_in_cart = [] totalprice_list = [] @@ -212,6 +211,7 @@ def cart(request): print(request.POST) # here we react to a currency dropdown change: if 'currencies' in request.POST: + print('currencies') currencies_form = CurrenciesForm(request.POST) if currencies_form.is_valid(): cf = currencies_form.cleaned_data @@ -223,9 +223,9 @@ def cart(request): else: request.session['currency'] = None # here we react to a change of amount per item in the Cart: - if 'amount_in_cart' in request.POST: + if 'amountfield' in request.POST: print('yes amount post') - amount = CartForm.ChangeAmount(request.POST) + if amount.is_valid(): amount = amount.cleaned_data['amount'] article = Article.objects.get(id=article_id) @@ -244,6 +244,7 @@ def cart(request): amount = CartForm.ChangeAmount() if 'checkout' in request.POST: + print('checkout') checkout_form = CheckoutForm(request.POST) if checkout_form.is_valid(): checkout_form = checkout_form.cleaned_data['checkout'] @@ -253,6 +254,8 @@ def cart(request): order = '' else: message = 'Plese accept our General Terms and Conditions!' + print('else') + checkout_form = CheckoutForm() # if the cart_id is set the user has already added items to cart. try: @@ -261,7 +264,6 @@ def cart(request): message = "You have no items in the Basket" if cart_id: - print(cart_id) articles = CartPosition.objects.filter(cart=cart_id) articles_list = list(articles) # scrap out the details to calculate Total of item and Summ of All: @@ -276,7 +278,7 @@ def cart(request): article.price_in_chf = rate.exchange( currency, article.price_in_chf) - amount = Decimal.from_float(article.amount) + amount = CartForm.ChangeAmount(request.POST, article.id) totalprice_list.append(article.position_price) articles_list[idx] = article From f78bfb6db063aa0f09331799139f47f757214807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ho=CC=88rler?= Date: Sun, 18 Feb 2018 19:31:03 +0100 Subject: [PATCH 3/3] change Model.Form to CartPosition --- django/didgeridoo/webshop/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/didgeridoo/webshop/forms.py b/django/didgeridoo/webshop/forms.py index 08e7beb..46145a7 100644 --- a/django/didgeridoo/webshop/forms.py +++ b/django/didgeridoo/webshop/forms.py @@ -5,7 +5,7 @@ from webshop.models import ( Picture, Article, Option, - OrderPosition + CartPosition ) @@ -71,7 +71,7 @@ class CartForm(forms.Form): print('CartForm') def ChangeAmount(self, _article_id): print('CartForm.ChangeAmount') - article = OrderPosition.objects.filter(pk=_article_id) + article = CartPosition.objects.filter(pk=_article_id) amountfield = forms.IntegerField( label='pce', help_text='Enter a Value between 1 and 99.',