From 4a1e818766e25877f96bf8e3e02394d326b3f764 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 13:57:35 +0100 Subject: [PATCH 01/13] add a source for fixtures --- docs/andreas.bib | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/andreas.bib b/docs/andreas.bib index aab7744..f18384b 100644 --- a/docs/andreas.bib +++ b/docs/andreas.bib @@ -115,3 +115,13 @@ year = {2018}, } +@misc{fixtures, + month = {{02}}, + note = {{\url{https://docs.djangoproject.com/en/2.0/howto/initial-data/}}}, + Url = {{https://docs.djangoproject.com/en/2.0/howto/initial-data/}}, + Urldate = {{2018-02-18}}, + author = {Django Foundation}, + title = {{Providing initial data for models}}, + year = {2018}, +} + From 88814d67e9f55f06c25774077f8906e1ea25ccfa Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:03:14 +0100 Subject: [PATCH 02/13] remove whitespace --- docs/doku.org | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/doku.org b/docs/doku.org index 1a54d71..862db42 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -340,16 +340,16 @@ 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 = { - rectangle, - font = \sffamily, + rectangle, + font = \sffamily, white, - top color = green!90!black, + top color = green!90!black, bottom color = green!60!black, - text width = 2.7cm, - align = center, + text width = 2.7cm, + align = center, minimum height = 1cm } ] @@ -1600,11 +1600,11 @@ Dieses snipet erklärt deren Nutzung: title eingefügt. {% block content %} --> wird in den block mit dem tag ''content'' eingefügt. {% endblock %} From 8318751ef4ff9e3d77b5bb58148656af78bccb05 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:03:25 +0100 Subject: [PATCH 03/13] add empty lines for better visibiliy --- docs/doku.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/doku.org b/docs/doku.org index 862db42..ecf2dbb 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -336,6 +336,7 @@ Am ende des Projekts die nicht lauffähigen teile ausgrenzen. :-) * Projektmanagement ** Organigram + #+CAPTION: Organigram #+NAME: fig:Organigram #+BEGIN_EXPORT latex @@ -364,6 +365,7 @@ Am ende des Projekts die nicht lauffähigen teile ausgrenzen. :-) (Unten) -| (BD); \end{tikzpicture} #+END_EXPORT + ** Projektstrukturplan ** Varianten From 868460f972f0d8b951fc7f36efab7bb2ec462782 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:03:41 +0100 Subject: [PATCH 04/13] remove todo tag --- docs/doku.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doku.org b/docs/doku.org index ecf2dbb..1be3435 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -708,7 +708,7 @@ Die Klassen Diagramme haben wir mit der Django Erweiterung "Django-Extensions"\footcite{django_extensions} erstellt. Django-Extensions ist freie Software unter der MIT Lizenz. -** TODO Spezifikation +** Spezifikation *** User Stories User Stories sind eine in Alltagssprache geschriebenen From 15de24943f7d144b2e4e6e124e8a26de067266e6 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:04:08 +0100 Subject: [PATCH 05/13] wrap the jinja template in a sexylisting environment --- docs/doku.org | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/doku.org b/docs/doku.org index 1be3435..735f4e4 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -1591,12 +1591,13 @@ die Datenbank mit zusätzlichen Anfragen belastet werden kann. *** Frontend Umsetzung Die Umsetztung des Frontends mittels Django integrierter Template -funktionen sind geprägt vom einstmalig eigenständigen Jinja Template -framework das auch in Python programmiert wurde. Mittlerweile ist es -integrierter bestandteil vom django Framework. -Dieses snipet erklärt deren Nutzung: -#+CAPTION: jinja Code Block -#+BEGIN_SRC python +Funktionen sind geprägt vom einstmalig eigenständigen Jinja Template +Framework das auch in Python programmiert wurde. Mittlerweile ist es +integrierter Bestandteil vom Django Framework. Dieses Snippet erklärt +deren Nutzung: + +#+BEGIN_EXPORT latex +\begin{sexylisting}{Jinja Code Block} {% extends 'base.html' %} --> Dieser codeblock wird im base.html eingefügt. {% block title %}Memberlist{% endblock %} --> Titel wird in den tag title eingefügt. @@ -1610,7 +1611,9 @@ jeden Benutzer wird eine listitem erstellt und der Username als text eingefügt. {% endfor %} {% endblock %} -#+END_SRC +\end{sexylisting} +#+END_EXPORT + *** Backend Umsetzung Django ist ein Modelbasiertes Framework das die Programmierung der From d707e846a754283e2afc03de40169d4b3e2ebe16 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:05:55 +0100 Subject: [PATCH 06/13] correct spelling mistakes --- docs/doku.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/doku.org b/docs/doku.org index 735f4e4..2a2a169 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -1616,10 +1616,10 @@ jeden Benutzer wird eine listitem erstellt und der Username als text eingefügt. *** Backend Umsetzung -Django ist ein Modelbasiertes Framework das die Programmierung der +Django ist ein modelbasiertes Framework das die Programmierung der Datenbank gleich selbst regelt. Dadurch lässt sich backendseitig -durchgängig in Python arbeiten. -Die Umsetzung gliedert sich vereinfacht in 3 Bereiche: +durchgängig in Python arbeiten. Die Umsetzung gliedert sich +vereinfacht in 3 Bereiche: 1. Einem Frontend dass für den Benutzer gemacht ist und das mehrere submodule wie Cathegories oder Wahrenkorb beinhaltet. 2. Ein Backend welches zum Bearbeiten/Erstellen von Produkten dient. From b133c85f877e87795563dd71b0e2aa8058bc2f0b Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:22:55 +0100 Subject: [PATCH 07/13] correct the bib entries --- docs/andreas.bib | 28 ++++++++++++++-------------- docs/andreas_general.bib | 32 ++++++++++++++++---------------- docs/bib.bib | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/andreas.bib b/docs/andreas.bib index f18384b..76ff1f1 100644 --- a/docs/andreas.bib +++ b/docs/andreas.bib @@ -1,7 +1,7 @@ @misc{djangoextensions, month = {{01}}, note = {{\url{https://github.com/django-extensions/django-extensions}}}, - Urldate = {{2018-01-05}}, + Urldate = {2018-01-05}, author = {django-extensions}, title = {{Django Extensions Source Code}}, year = {2018}, @@ -10,7 +10,7 @@ @book{djangobook, Note = {{\url{https://djangobook.com/}}}, publisher = {{leanpub.com}}, - Urldate = {{2018-01-08}}, + Urldate = {2018-01-08}, author = {Nigel George}, title = {{Mastering Django: Core}}, year = {2016}, @@ -19,7 +19,7 @@ @misc{removeadd, month = {{01}}, note = {{\url{https://stackoverflow.com/a/21454467/7723859}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Avinash Garg}, title = {{How to remove Add button in Django admin, for specific Model?}}, year = {2014}, @@ -28,7 +28,7 @@ @misc{removedelete, month = {{08}}, note = {{\url{https://stackoverflow.com/a/7031093/7723859}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Jonathan R.}, title = {{In Django Admin how do I disable the Delete link}}, year = {2011}, @@ -37,7 +37,7 @@ @misc{readonly, month = {{09}}, note = {{\url{https://stackoverflow.com/a/46124159/7723859}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {gdlmx}, title = {{Display a model field as readonly in Django admin}}, year = {2017}, @@ -46,7 +46,7 @@ @misc{timezone, month = {{07}}, note = {{\url{https://stackoverflow.com/a/38239673}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Antoine Pinsard}, title = {{Django: timezone.now vs timezone.now()}}, year = {2016}, @@ -55,7 +55,7 @@ @misc{usermodel, month = {{07}}, note = {{\url{https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Vitor Freitas}, title = {{How to Extend Django User Model}}, year = {2016}, @@ -64,7 +64,7 @@ @misc{djangogirls, month = {{10}}, note = {{\url{https://tutorial.djangogirls.org/en/}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {DjangoGirls}, title = {{Django Girls Tutorial}}, year = {2017}, @@ -73,7 +73,7 @@ @misc{images, month = {{08}}, note = {{\url{https://stackoverflow.com/a/1235542}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {steve}, title = {{How do I include image files in Django templates?}}, year = {2009}, @@ -82,7 +82,7 @@ @misc{djangodoc, month = {{01}}, note = {{\url{https://docs.djangoproject.com/en/1.11/}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Django Foundation}, title = {{Django documentation}}, year = {2018}, @@ -91,7 +91,7 @@ @misc{upload, month = {{12}}, note = {{\url{https://stackoverflow.com/a/8542030}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Akseli Pal{\'{e}}n}, title = {{Need a minimal Django file upload example [closed]}}, year = {2011}, @@ -100,7 +100,7 @@ @misc{tree, month = {{11}}, note = {{\url{https://stackoverflow.com/a/8177290/7723859}}}, - Urldate = {{2018-01-15}}, + Urldate = {2018-01-15}, author = {Acorn}, title = {{Django hierarchical model list}}, year = {2011}, @@ -109,7 +109,7 @@ @misc{snb, month = {{01}}, note = {{\url{https://www.snb.ch/selector/de/mmr/exfeed/rss}}}, - Urldate = {{2018-02-01}}, + Urldate = {2018-02-01}, author = {Schweizerische National Bank}, title = {{SNB Devisenkurse}}, year = {2018}, @@ -119,7 +119,7 @@ month = {{02}}, note = {{\url{https://docs.djangoproject.com/en/2.0/howto/initial-data/}}}, Url = {{https://docs.djangoproject.com/en/2.0/howto/initial-data/}}, - Urldate = {{2018-02-18}}, + Urldate = {2018-02-18}, author = {Django Foundation}, title = {{Providing initial data for models}}, year = {2018}, diff --git a/docs/andreas_general.bib b/docs/andreas_general.bib index 0be37ca..a15c998 100644 --- a/docs/andreas_general.bib +++ b/docs/andreas_general.bib @@ -9,7 +9,7 @@ @misc{ansible, month = {{01}}, note = {{\url{https://www.ansible.com/}}}, - Urldate = {{2018-01-03}}, + Urldate = {2018-01-03}, author = {Ansible, Red Hat}, title = {{Ansible - IT Automation Software}}, year = {2018}, @@ -26,7 +26,7 @@ @misc{latex, month = {{01}}, note = {{\url{https://www.latex-project.org/}}}, - Urldate = {{2018-01-03}}, + Urldate = {2018-01-03}, author = {Leslie Lamport}, title = {{LaTeX - A document preparation system}}, year = {2018}, @@ -35,7 +35,7 @@ @misc{debian, month = {{01}}, note = {{\url{https://www.debian.org/}}}, - Urldate = {{2018-01-03}}, + Urldate = {2018-01-03}, author = {Debian Project}, title = {{Debian {--} The Universal Operating System}}, year = {2018}, @@ -44,7 +44,7 @@ @misc{gplv3, month = {{01}}, note = {{\url{https://www.gnu.org/licenses/gpl-3.0.en.html}}}, - Urldate = {{2018-01-03}}, + Urldate = {2018-01-03}, author = {Free Software Foundation}, title = {{GPLv3}}, year = {2018}, @@ -53,7 +53,7 @@ @misc{usecase, month = {{01}}, note = {{\url{https://de.wikipedia.org/wiki/Anwendungsfall}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {Wikipedia}, title = {{Anwendungsfall {--} Wikipedia}}, year = {2018}, @@ -62,7 +62,7 @@ @misc{usecasediagramm, month = {{01}}, note = {{\url{https://de.wikipedia.org/wiki/Anwendungsfalldiagramm}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {Wikipedia}, title = {{Anwendungsfalldiagramm {--} Wikipedia}}, year = {2018}, @@ -71,7 +71,7 @@ @misc{django, month = {{01}}, note = {{\url{https://www.djangoproject.com/}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {Django Project}, title = {{Django Framework}}, year = {2018}, @@ -80,7 +80,7 @@ @misc{apache, month = {{01}}, note = {{\url{https://httpd.apache.org/}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {Apache Foundation}, title = {{The Apache HTTP Server Project}}, year = {2018}, @@ -89,7 +89,7 @@ @misc{mariadb, month = {{01}}, note = {{\url{https://mariadb.org/}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {Mariadb Foundation}, title = {{MariaDB}}, year = {2018}, @@ -98,7 +98,7 @@ @misc{emacs, month = {{01}}, note = {{\url{https://www.gnu.org/software/emacs/}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {GNU Project}, title = {{GNU Emacs}}, year = {2018}, @@ -107,7 +107,7 @@ @misc{atom, month = {{01}}, note = {{\url{https://atom.io/}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {GitHub Inc.}, title = {{Atom Editor}}, year = {2018}, @@ -116,7 +116,7 @@ @misc{mariadbgov, month = {{01}}, note = {{\url{https://mariadb.org/about/governance/}}}, - Urldate = {{2018-01-04}}, + Urldate = {2018-01-04}, author = {MariaDB Foundation}, title = {{Governance}}, year = {2018}, @@ -125,7 +125,7 @@ @misc{inkscape, month = {{01}}, note = {{\url{https://inkscape.org/en/}}}, - Urldate = {{2018-01-05}}, + Urldate = {2018-01-05}, author = {Inkscape Developers}, title = {{Inkscape}}, year = {2018}, @@ -134,7 +134,7 @@ @misc{orgmode, month = {{01}}, note = {{\url{https://orgmode.org/}}}, - Urldate = {{2018-01-05}}, + Urldate = {2018-01-05}, author = {Carsten Dominik}, title = {{Org mode for Emacs}}, year = {2018}, @@ -143,7 +143,7 @@ @misc{virtualbox, month = {{01}}, note = {{\url{https://www.virtualbox.org/}}}, - Urldate = {{2018-01-05}}, + Urldate = {2018-01-05}, author = {Oracle}, title = {{Oracle VM VirtualBox}}, year = {2018}, @@ -152,7 +152,7 @@ @misc{dia, month = {{02}}, note = {{\url{http://dia-installer.de/}}}, - Urldate = {{2018-02-06}}, + Urldate = {2018-02-06}, author = {Macke, Steffen}, title = {{Dia draws your structured diagrams: Free Windows, Mac OS X and Linux version of the popular open source program}}, year = {2018}, diff --git a/docs/bib.bib b/docs/bib.bib index a759e6d..24cf059 100644 --- a/docs/bib.bib +++ b/docs/bib.bib @@ -12,7 +12,7 @@ Day = {20}, Month = {09}, Note = {\url{https://www.swr.de/blog/1000antworten/antwort/10380/woher-kommt-der-name-didgeridoo/}}, - Urldate = {2011-09-11}, + Urldate = {2018-02-17}, author = {Desirée Kuthe}, title = {Wie kommt das Didgeridoo zu seinem Namen?}, year = {2011}, From c06999d9807ce8824817c8e27537977122178fce Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:23:23 +0100 Subject: [PATCH 08/13] add a entry about testing --- docs/doku.org | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/doku.org b/docs/doku.org index 2a2a169..b7a24df 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -1627,7 +1627,29 @@ vereinfacht in 3 Bereiche: ** Testing -*** Fixtures +Um die Funktionalität des Webshops sicherzustellen haben wir +Die Applikation kontinuierlich gemäss den Testfällen unter [[Testfälle]] +getestet und geprüft. Auch sehr hilfreich war das Admin Interface von +Django. Damit konnten wir die Modells sehr gut auf ihre Funktionalität +überprüfen bevor wir sie im Frontend verwendeten. + +*Fixtures* + +Django hat ein Funktion\footcite{fixtures} genannt "Fixtures" welche +es einem erlaubt fixe Daten in die Datenbank zu schreiben. Dabei +werden die Daten in YAML Syntax in eine .yaml Datei geschrieben und +mittels folgendem Befehl dann in die Datenbank geladen: + +#+BEGIN_EXPORT latex +\begin{sexylisting}{Fixtures in Datenbank laden.} +python3 /vagrant/django/didgeridoo/manage.py loaddata webshop +\end{sexylisting} +#+END_EXPORT + +Wir haben diese Funktion verwendet um Testdaten in der Datenbank zu +speichern. Somit mussten wir etwa nicht von Hand Artikel oder User +erfassen. Zumindest nicht mehr sobald wir sicher waren das die +dazugehörige Funktionen korrekt funktionieren. #+LATEX:\newpage #+LATEX:\begin{landscape} From a9bec6a329fce207b9016df64748e3733bf58164 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:57:20 +0100 Subject: [PATCH 09/13] fix a typo --- docs/doku.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/doku.org b/docs/doku.org index b7a24df..b16adf5 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -1154,7 +1154,7 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet: |---------------------+--------------------------------| | *Preconditions* | Account mit Administrationsrechten vorhanden. | |---------------------+--------------------------------| -| *Postconditions* | Der Artikel wir im Webshop angezeigt. | +| *Postconditions* | Der Artikel wird im Webshop angezeigt. | |---------------------+--------------------------------| | *Normal Flow* | 1. Der Administrator loggt sich unter https://didgeridoo.ml/admin ein. | | | 2. Admin klickt neben "Articles" auf "+ Add". | @@ -1173,6 +1173,7 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet: | *Notes* | - | |---------------------+--------------------------------| | *UC History* | 1.0 Darft erstellt durch AZ | +| | 1.1 AZ Rechtschreibung korrigiert | |---------------------+--------------------------------| | *Author* | A. Zweili & I. Hörler | |---------------------+--------------------------------| From 13f1832bad603898f1f547ef2c7f54e43d8a9cd2 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 14:57:38 +0100 Subject: [PATCH 10/13] add another use case --- docs/doku.org | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/doku.org b/docs/doku.org index b16adf5..b5045a8 100644 --- a/docs/doku.org +++ b/docs/doku.org @@ -815,7 +815,7 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet: | - [[Checkout][3.2 Checkout]] | - [[Bestellung %C3%A4ndern/korrigieren][7.0 Bestellung ändern/korrigieren (Admin Funktion)]] | | - [[User Passwort %C3%A4ndern][4.0 User Passwort ändern (Admin Funktion)]] | - Bestellung löschen (Admin Funktion) | | - [[Artikel erfassen][5.0 Artikel erfassen (Admin Funktion)]] | - [[max_pictures Option anpassen][6.0 max_pictures Option anpassen (Admin Funktion)]] | -| - Artikel ändern (Admin Funktion) | - max_pictures Option deaktivieren (Admin Funktion) | +| - [[Artikel %C3%A4ndern][5.1 Artikel ändern (Admin Funktion)]] | - max_pictures Option deaktivieren (Admin Funktion) | | - Artikel löschen (Admin Funktion) | - User erfassen (Admin Funktion) | | - Materialbestellung erfassen (Admin Funktion) | - User/Personen Daten ändern (Admin Funktion) | | - Materialbestellung ändern/korrigieren (Admin Funktion) | - User löschen (Admin Funktion) | @@ -1181,6 +1181,48 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet: |---------------------+--------------------------------| #+LATEX:} +***** Artikel ändern + +#+LATEX:{\footnotesize +#+CAPTION: 5.1 Artikel ändern +#+ATTR_LATEX: :environment longtable :align |>{\columncolor[HTML]{EFEFEF}}p{.25\textwidth}|p{.7\textwidth}| :placement [H] +#+NAME: tab:create_article +|---------------------+--------------------------------| +| | <30> | +| *Identifier + Name* | 5.1 Artikel ändern | +|---------------------+--------------------------------| +| *Description* | Ein Administrator ändert den Status eines Artikels. | +|---------------------+--------------------------------| +| *Actors* | Verwaltung | +|---------------------+--------------------------------| +| *Status* | Freigeben | +|---------------------+--------------------------------| +| *Includes* | - | +|---------------------+--------------------------------| +| *Trigger* | Ein Artikel wird vorübergehend aus dem Sortiment genommen. | +|---------------------+--------------------------------| +| *Preconditions* | Account mit Administrationsrechten vorhanden. | +|---------------------+--------------------------------| +| *Postconditions* | Der Artikel wird im Webshop nicht mehr angezeigt. | +|---------------------+--------------------------------| +| *Normal Flow* | 1. Der Administrator loggt sich unter https://didgeridoo.ml/admin ein. | +| | 2. Admin wählte in der Kategorie Articles einen "Artikel" aus. | +| | 3. Der Admin ändert den Artikel Status von "active" auf "hidden". | +| | 4. Klickt unten rechts auf "Save". | +| | 5. Die Website speichert den Artikel in der Datenbank. | +|---------------------+--------------------------------| +| *Alternative Flow* | - | +|---------------------+--------------------------------| +| *Notes* | - | +|---------------------+--------------------------------| +| *UC History* | 1.0 Darft erstellt durch AZ | +|---------------------+--------------------------------| +| *Author* | A. Zweili & I. Hörler | +|---------------------+--------------------------------| +| *Date* | 18.02.2018 | +|---------------------+--------------------------------| +#+LATEX:} + ***** max_pictures Option anpassen #+LATEX:{\footnotesize From 190242bbb706ae11c5cf858bd1d163207e6f440e Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 18:33:14 +0100 Subject: [PATCH 11/13] add surround the submit button with a P Tag --- .../didgeridoo/webshop/templates/webshop/article_details.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/didgeridoo/webshop/templates/webshop/article_details.html b/django/didgeridoo/webshop/templates/webshop/article_details.html index a16a642..f611601 100644 --- a/django/didgeridoo/webshop/templates/webshop/article_details.html +++ b/django/didgeridoo/webshop/templates/webshop/article_details.html @@ -7,11 +7,13 @@

Status: {{ article.status }}

Price: {{ article.price_in_chf }} {{ currency_name }}

{% if user.is_authenticated %} +

{{ amount.as_p }} {% csrf_token %}
+

{% else %}

please login to fill your basket...

{% endif %} From 0d697114cf3e3975cd2b0cbd2330d1ba8cc1e383 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 18:37:21 +0100 Subject: [PATCH 12/13] remove the inline pictures from the Article admin page I've removed the inline pictures because when you upload more than the maximum allowed pictures at once it still works. Only if you upload them one after the other the check works. Therefor it's safer to only allow the upload through the Picture admin page. This way the check works every time. --- django/didgeridoo/webshop/admin.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/django/didgeridoo/webshop/admin.py b/django/didgeridoo/webshop/admin.py index e3d5f74..e0a8803 100644 --- a/django/didgeridoo/webshop/admin.py +++ b/django/didgeridoo/webshop/admin.py @@ -53,10 +53,6 @@ class UserAdmin(BaseUserAdmin): inlines = (PersonInline,) -class ArticleAdmin(admin.ModelAdmin): - inlines = (PictureInline,) - - class OrderPositionInline(admin.StackedInline): model = OrderPosition can_delete = False @@ -81,7 +77,7 @@ class OrderOfGoodsAdmin(admin.ModelAdmin): admin.site.unregister(User) admin.site.register(User, UserAdmin) -admin.site.register(Article, ArticleAdmin) +admin.site.register(Article) admin.site.register(Order, OrderAdmin) admin.site.register(Picture, PictureAdmin) admin.site.register(City) From 147bc7531ec54a1639efd008fd25ecd918d58a38 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 18 Feb 2018 18:40:55 +0100 Subject: [PATCH 13/13] some corrections to comply with PEP8 --- django/didgeridoo/webshop/admin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/django/didgeridoo/webshop/admin.py b/django/didgeridoo/webshop/admin.py index e0a8803..340d76c 100644 --- a/django/didgeridoo/webshop/admin.py +++ b/django/didgeridoo/webshop/admin.py @@ -32,17 +32,16 @@ class PictureInline(admin.StackedInline): class OptionAdmin(admin.ModelAdmin): model = Option list_display = ('name', 'description',) - readonly_fields = ('name','description',) - + readonly_fields = ('name', 'description',) def get_actions(self, request): - #Disable delete + # Disable delete actions = super(OptionAdmin, self).get_actions(request) del actions['delete_selected'] return actions def has_delete_permission(self, request, obj=None): - #Disable delete + # Disable delete return False def has_add_permission(self, request):