Merge branch 'cart' of git.2li.ch:ibz/web_AI-5 into cart

* 'cart' of git.2li.ch:ibz/web_AI-5:
  some corrections to comply with PEP8
  remove the inline pictures from the Article admin page
  add surround the submit button with a P Tag
  add another use case
  fix a typo
  add a entry about testing
  correct the bib entries
  correct spelling mistakes
  wrap the jinja template in a sexylisting environment
  remove todo tag
  add empty lines for better visibiliy
  remove whitespace
  add a source for fixtures
This commit is contained in:
Ivan Hörler 2018-02-18 21:59:04 +01:00
commit 29e99e49c0
6 changed files with 140 additions and 64 deletions

View File

@ -32,17 +32,16 @@ class PictureInline(admin.StackedInline):
class OptionAdmin(admin.ModelAdmin): class OptionAdmin(admin.ModelAdmin):
model = Option model = Option
list_display = ('name', 'description',) list_display = ('name', 'description',)
readonly_fields = ('name','description',) readonly_fields = ('name', 'description',)
def get_actions(self, request): def get_actions(self, request):
#Disable delete # Disable delete
actions = super(OptionAdmin, self).get_actions(request) actions = super(OptionAdmin, self).get_actions(request)
del actions['delete_selected'] del actions['delete_selected']
return actions return actions
def has_delete_permission(self, request, obj=None): def has_delete_permission(self, request, obj=None):
#Disable delete # Disable delete
return False return False
def has_add_permission(self, request): def has_add_permission(self, request):
@ -53,10 +52,6 @@ class UserAdmin(BaseUserAdmin):
inlines = (PersonInline,) inlines = (PersonInline,)
class ArticleAdmin(admin.ModelAdmin):
inlines = (PictureInline,)
class OrderPositionInline(admin.StackedInline): class OrderPositionInline(admin.StackedInline):
model = OrderPosition model = OrderPosition
can_delete = False can_delete = False
@ -81,7 +76,7 @@ class OrderOfGoodsAdmin(admin.ModelAdmin):
admin.site.unregister(User) admin.site.unregister(User)
admin.site.register(User, UserAdmin) admin.site.register(User, UserAdmin)
admin.site.register(Article, ArticleAdmin) admin.site.register(Article)
admin.site.register(Order, OrderAdmin) admin.site.register(Order, OrderAdmin)
admin.site.register(Picture, PictureAdmin) admin.site.register(Picture, PictureAdmin)
admin.site.register(City) admin.site.register(City)

View File

@ -7,11 +7,13 @@
<p><b>Status:</b> {{ article.status }}</p> <p><b>Status:</b> {{ article.status }}</p>
<p><b>Price:</b> {{ article.price_in_chf }} {{ currency_name }}</p> <p><b>Price:</b> {{ article.price_in_chf }} {{ currency_name }}</p>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<p>
<form id="amount" action="" method="POST" novalidate> <form id="amount" action="" method="POST" novalidate>
{{ amount.as_p }} {{ amount.as_p }}
<input type="submit" value="Add to Cart" /> <input type="submit" value="Add to Cart" />
{% csrf_token %} {% csrf_token %}
</form> </form>
</p>
{% else %} {% else %}
<p> please login to fill your basket...</p> <p> please login to fill your basket...</p>
{% endif %} {% endif %}

View File

@ -1,7 +1,7 @@
@misc{djangoextensions, @misc{djangoextensions,
month = {{01}}, month = {{01}},
note = {{\url{https://github.com/django-extensions/django-extensions}}}, note = {{\url{https://github.com/django-extensions/django-extensions}}},
Urldate = {{2018-01-05}}, Urldate = {2018-01-05},
author = {django-extensions}, author = {django-extensions},
title = {{Django Extensions Source Code}}, title = {{Django Extensions Source Code}},
year = {2018}, year = {2018},
@ -10,7 +10,7 @@
@book{djangobook, @book{djangobook,
Note = {{\url{https://djangobook.com/}}}, Note = {{\url{https://djangobook.com/}}},
publisher = {{leanpub.com}}, publisher = {{leanpub.com}},
Urldate = {{2018-01-08}}, Urldate = {2018-01-08},
author = {Nigel George}, author = {Nigel George},
title = {{Mastering Django: Core}}, title = {{Mastering Django: Core}},
year = {2016}, year = {2016},
@ -19,7 +19,7 @@
@misc{removeadd, @misc{removeadd,
month = {{01}}, month = {{01}},
note = {{\url{https://stackoverflow.com/a/21454467/7723859}}}, note = {{\url{https://stackoverflow.com/a/21454467/7723859}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {Avinash Garg}, author = {Avinash Garg},
title = {{How to remove Add button in Django admin, for specific Model?}}, title = {{How to remove Add button in Django admin, for specific Model?}},
year = {2014}, year = {2014},
@ -28,7 +28,7 @@
@misc{removedelete, @misc{removedelete,
month = {{08}}, month = {{08}},
note = {{\url{https://stackoverflow.com/a/7031093/7723859}}}, note = {{\url{https://stackoverflow.com/a/7031093/7723859}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {Jonathan R.}, author = {Jonathan R.},
title = {{In Django Admin how do I disable the Delete link}}, title = {{In Django Admin how do I disable the Delete link}},
year = {2011}, year = {2011},
@ -37,7 +37,7 @@
@misc{readonly, @misc{readonly,
month = {{09}}, month = {{09}},
note = {{\url{https://stackoverflow.com/a/46124159/7723859}}}, note = {{\url{https://stackoverflow.com/a/46124159/7723859}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {gdlmx}, author = {gdlmx},
title = {{Display a model field as readonly in Django admin}}, title = {{Display a model field as readonly in Django admin}},
year = {2017}, year = {2017},
@ -46,7 +46,7 @@
@misc{timezone, @misc{timezone,
month = {{07}}, month = {{07}},
note = {{\url{https://stackoverflow.com/a/38239673}}}, note = {{\url{https://stackoverflow.com/a/38239673}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {Antoine Pinsard}, author = {Antoine Pinsard},
title = {{Django: timezone.now vs timezone.now()}}, title = {{Django: timezone.now vs timezone.now()}},
year = {2016}, year = {2016},
@ -55,7 +55,7 @@
@misc{usermodel, @misc{usermodel,
month = {{07}}, month = {{07}},
note = {{\url{https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html}}}, 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}, author = {Vitor Freitas},
title = {{How to Extend Django User Model}}, title = {{How to Extend Django User Model}},
year = {2016}, year = {2016},
@ -64,7 +64,7 @@
@misc{djangogirls, @misc{djangogirls,
month = {{10}}, month = {{10}},
note = {{\url{https://tutorial.djangogirls.org/en/}}}, note = {{\url{https://tutorial.djangogirls.org/en/}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {DjangoGirls}, author = {DjangoGirls},
title = {{Django Girls Tutorial}}, title = {{Django Girls Tutorial}},
year = {2017}, year = {2017},
@ -73,7 +73,7 @@
@misc{images, @misc{images,
month = {{08}}, month = {{08}},
note = {{\url{https://stackoverflow.com/a/1235542}}}, note = {{\url{https://stackoverflow.com/a/1235542}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {steve}, author = {steve},
title = {{How do I include image files in Django templates?}}, title = {{How do I include image files in Django templates?}},
year = {2009}, year = {2009},
@ -82,7 +82,7 @@
@misc{djangodoc, @misc{djangodoc,
month = {{01}}, month = {{01}},
note = {{\url{https://docs.djangoproject.com/en/1.11/}}}, note = {{\url{https://docs.djangoproject.com/en/1.11/}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {Django Foundation}, author = {Django Foundation},
title = {{Django documentation}}, title = {{Django documentation}},
year = {2018}, year = {2018},
@ -91,7 +91,7 @@
@misc{upload, @misc{upload,
month = {{12}}, month = {{12}},
note = {{\url{https://stackoverflow.com/a/8542030}}}, note = {{\url{https://stackoverflow.com/a/8542030}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {Akseli Pal{\'{e}}n}, author = {Akseli Pal{\'{e}}n},
title = {{Need a minimal Django file upload example [closed]}}, title = {{Need a minimal Django file upload example [closed]}},
year = {2011}, year = {2011},
@ -100,7 +100,7 @@
@misc{tree, @misc{tree,
month = {{11}}, month = {{11}},
note = {{\url{https://stackoverflow.com/a/8177290/7723859}}}, note = {{\url{https://stackoverflow.com/a/8177290/7723859}}},
Urldate = {{2018-01-15}}, Urldate = {2018-01-15},
author = {Acorn}, author = {Acorn},
title = {{Django hierarchical model list}}, title = {{Django hierarchical model list}},
year = {2011}, year = {2011},
@ -109,9 +109,19 @@
@misc{snb, @misc{snb,
month = {{01}}, month = {{01}},
note = {{\url{https://www.snb.ch/selector/de/mmr/exfeed/rss}}}, note = {{\url{https://www.snb.ch/selector/de/mmr/exfeed/rss}}},
Urldate = {{2018-02-01}}, Urldate = {2018-02-01},
author = {Schweizerische National Bank}, author = {Schweizerische National Bank},
title = {{SNB Devisenkurse}}, title = {{SNB Devisenkurse}},
year = {2018}, 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},
}

View File

@ -9,7 +9,7 @@
@misc{ansible, @misc{ansible,
month = {{01}}, month = {{01}},
note = {{\url{https://www.ansible.com/}}}, note = {{\url{https://www.ansible.com/}}},
Urldate = {{2018-01-03}}, Urldate = {2018-01-03},
author = {Ansible, Red Hat}, author = {Ansible, Red Hat},
title = {{Ansible - IT Automation Software}}, title = {{Ansible - IT Automation Software}},
year = {2018}, year = {2018},
@ -26,7 +26,7 @@
@misc{latex, @misc{latex,
month = {{01}}, month = {{01}},
note = {{\url{https://www.latex-project.org/}}}, note = {{\url{https://www.latex-project.org/}}},
Urldate = {{2018-01-03}}, Urldate = {2018-01-03},
author = {Leslie Lamport}, author = {Leslie Lamport},
title = {{LaTeX - A document preparation system}}, title = {{LaTeX - A document preparation system}},
year = {2018}, year = {2018},
@ -35,7 +35,7 @@
@misc{debian, @misc{debian,
month = {{01}}, month = {{01}},
note = {{\url{https://www.debian.org/}}}, note = {{\url{https://www.debian.org/}}},
Urldate = {{2018-01-03}}, Urldate = {2018-01-03},
author = {Debian Project}, author = {Debian Project},
title = {{Debian {--} The Universal Operating System}}, title = {{Debian {--} The Universal Operating System}},
year = {2018}, year = {2018},
@ -44,7 +44,7 @@
@misc{gplv3, @misc{gplv3,
month = {{01}}, month = {{01}},
note = {{\url{https://www.gnu.org/licenses/gpl-3.0.en.html}}}, note = {{\url{https://www.gnu.org/licenses/gpl-3.0.en.html}}},
Urldate = {{2018-01-03}}, Urldate = {2018-01-03},
author = {Free Software Foundation}, author = {Free Software Foundation},
title = {{GPLv3}}, title = {{GPLv3}},
year = {2018}, year = {2018},
@ -53,7 +53,7 @@
@misc{usecase, @misc{usecase,
month = {{01}}, month = {{01}},
note = {{\url{https://de.wikipedia.org/wiki/Anwendungsfall}}}, note = {{\url{https://de.wikipedia.org/wiki/Anwendungsfall}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {Wikipedia}, author = {Wikipedia},
title = {{Anwendungsfall {--} Wikipedia}}, title = {{Anwendungsfall {--} Wikipedia}},
year = {2018}, year = {2018},
@ -62,7 +62,7 @@
@misc{usecasediagramm, @misc{usecasediagramm,
month = {{01}}, month = {{01}},
note = {{\url{https://de.wikipedia.org/wiki/Anwendungsfalldiagramm}}}, note = {{\url{https://de.wikipedia.org/wiki/Anwendungsfalldiagramm}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {Wikipedia}, author = {Wikipedia},
title = {{Anwendungsfalldiagramm {--} Wikipedia}}, title = {{Anwendungsfalldiagramm {--} Wikipedia}},
year = {2018}, year = {2018},
@ -71,7 +71,7 @@
@misc{django, @misc{django,
month = {{01}}, month = {{01}},
note = {{\url{https://www.djangoproject.com/}}}, note = {{\url{https://www.djangoproject.com/}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {Django Project}, author = {Django Project},
title = {{Django Framework}}, title = {{Django Framework}},
year = {2018}, year = {2018},
@ -80,7 +80,7 @@
@misc{apache, @misc{apache,
month = {{01}}, month = {{01}},
note = {{\url{https://httpd.apache.org/}}}, note = {{\url{https://httpd.apache.org/}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {Apache Foundation}, author = {Apache Foundation},
title = {{The Apache HTTP Server Project}}, title = {{The Apache HTTP Server Project}},
year = {2018}, year = {2018},
@ -89,7 +89,7 @@
@misc{mariadb, @misc{mariadb,
month = {{01}}, month = {{01}},
note = {{\url{https://mariadb.org/}}}, note = {{\url{https://mariadb.org/}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {Mariadb Foundation}, author = {Mariadb Foundation},
title = {{MariaDB}}, title = {{MariaDB}},
year = {2018}, year = {2018},
@ -98,7 +98,7 @@
@misc{emacs, @misc{emacs,
month = {{01}}, month = {{01}},
note = {{\url{https://www.gnu.org/software/emacs/}}}, note = {{\url{https://www.gnu.org/software/emacs/}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {GNU Project}, author = {GNU Project},
title = {{GNU Emacs}}, title = {{GNU Emacs}},
year = {2018}, year = {2018},
@ -107,7 +107,7 @@
@misc{atom, @misc{atom,
month = {{01}}, month = {{01}},
note = {{\url{https://atom.io/}}}, note = {{\url{https://atom.io/}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {GitHub Inc.}, author = {GitHub Inc.},
title = {{Atom Editor}}, title = {{Atom Editor}},
year = {2018}, year = {2018},
@ -116,7 +116,7 @@
@misc{mariadbgov, @misc{mariadbgov,
month = {{01}}, month = {{01}},
note = {{\url{https://mariadb.org/about/governance/}}}, note = {{\url{https://mariadb.org/about/governance/}}},
Urldate = {{2018-01-04}}, Urldate = {2018-01-04},
author = {MariaDB Foundation}, author = {MariaDB Foundation},
title = {{Governance}}, title = {{Governance}},
year = {2018}, year = {2018},
@ -125,7 +125,7 @@
@misc{inkscape, @misc{inkscape,
month = {{01}}, month = {{01}},
note = {{\url{https://inkscape.org/en/}}}, note = {{\url{https://inkscape.org/en/}}},
Urldate = {{2018-01-05}}, Urldate = {2018-01-05},
author = {Inkscape Developers}, author = {Inkscape Developers},
title = {{Inkscape}}, title = {{Inkscape}},
year = {2018}, year = {2018},
@ -134,7 +134,7 @@
@misc{orgmode, @misc{orgmode,
month = {{01}}, month = {{01}},
note = {{\url{https://orgmode.org/}}}, note = {{\url{https://orgmode.org/}}},
Urldate = {{2018-01-05}}, Urldate = {2018-01-05},
author = {Carsten Dominik}, author = {Carsten Dominik},
title = {{Org mode for Emacs}}, title = {{Org mode for Emacs}},
year = {2018}, year = {2018},
@ -143,7 +143,7 @@
@misc{virtualbox, @misc{virtualbox,
month = {{01}}, month = {{01}},
note = {{\url{https://www.virtualbox.org/}}}, note = {{\url{https://www.virtualbox.org/}}},
Urldate = {{2018-01-05}}, Urldate = {2018-01-05},
author = {Oracle}, author = {Oracle},
title = {{Oracle VM VirtualBox}}, title = {{Oracle VM VirtualBox}},
year = {2018}, year = {2018},
@ -152,7 +152,7 @@
@misc{dia, @misc{dia,
month = {{02}}, month = {{02}},
note = {{\url{http://dia-installer.de/}}}, note = {{\url{http://dia-installer.de/}}},
Urldate = {{2018-02-06}}, Urldate = {2018-02-06},
author = {Macke, Steffen}, author = {Macke, Steffen},
title = {{Dia draws your structured diagrams: Free Windows, Mac OS X and Linux version of the popular open source program}}, title = {{Dia draws your structured diagrams: Free Windows, Mac OS X and Linux version of the popular open source program}},
year = {2018}, year = {2018},

View File

@ -12,7 +12,7 @@
Day = {20}, Day = {20},
Month = {09}, Month = {09},
Note = {\url{https://www.swr.de/blog/1000antworten/antwort/10380/woher-kommt-der-name-didgeridoo/}}, 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}, author = {Desirée Kuthe},
title = {Wie kommt das Didgeridoo zu seinem Namen?}, title = {Wie kommt das Didgeridoo zu seinem Namen?},
year = {2011}, year = {2011},

View File

@ -336,21 +336,22 @@ Am ende des Projekts die nicht lauffähigen teile ausgrenzen. :-)
* Projektmanagement * Projektmanagement
** Organigram ** Organigram
#+CAPTION: Organigram #+CAPTION: Organigram
#+NAME: fig:Organigram #+NAME: fig:Organigram
#+BEGIN_EXPORT latex #+BEGIN_EXPORT latex
\begin{tikzpicture}[ \begin{tikzpicture}[
auto, auto,
node distance = 0.4cm, node distance = 0.4cm,
thick, thick,
every node/.style = { every node/.style = {
rectangle, rectangle,
font = \sffamily, font = \sffamily,
white, white,
top color = green!90!black, top color = green!90!black,
bottom color = green!60!black, bottom color = green!60!black,
text width = 2.4cm, text width = 2.4cm,
align = center, align = center,
minimum height = 1cm minimum height = 1cm
} }
] ]
@ -361,11 +362,11 @@ Am ende des Projekts die nicht lauffähigen teile ausgrenzen. :-)
\node (AZ) [below = of CV] {\textbf{AZ}\\Andreas Zweili}; \node (AZ) [below = of CV] {\textbf{AZ}\\Andreas Zweili};
\node (IH) [left = of AZ] {\textbf{IH}\\Ivan Hörler}; \node (IH) [left = of AZ] {\textbf{IH}\\Ivan Hörler};
\draw [green!60!black,thick] \draw [green!60!black,thick]
(CH) -- (Mitte) (CH) -- (Mitte)
(CV) -- (Mitte) -- (Unten) -| (IH) (CV) -- (Mitte) -- (Unten) -| (IH)
(Unten) -| (IH) (Unten) -| (IH)
(Unten) -| (AZ); (Unten) -| (AZ);
\end{tikzpicture} \end{tikzpicture}
#+END_EXPORT #+END_EXPORT
** Projektstrukturplan ** Projektstrukturplan
** Varianten ** Varianten
@ -709,7 +710,7 @@ Die Klassen Diagramme haben wir mit der Django Erweiterung
"Django-Extensions"\footcite{django_extensions} erstellt. "Django-Extensions"\footcite{django_extensions} erstellt.
Django-Extensions ist freie Software unter der MIT Lizenz. Django-Extensions ist freie Software unter der MIT Lizenz.
** TODO Spezifikation ** Spezifikation
*** User Stories *** User Stories
User Stories sind eine in Alltagssprache geschriebenen User Stories sind eine in Alltagssprache geschriebenen
@ -816,7 +817,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)]] | | - [[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) | | - [[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 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) | | - Artikel löschen (Admin Funktion) | - User erfassen (Admin Funktion) |
| - Materialbestellung erfassen (Admin Funktion) | - User/Personen Daten ändern (Admin Funktion) | | - Materialbestellung erfassen (Admin Funktion) | - User/Personen Daten ändern (Admin Funktion) |
| - Materialbestellung ändern/korrigieren (Admin Funktion) | - User löschen (Admin Funktion) | | - Materialbestellung ändern/korrigieren (Admin Funktion) | - User löschen (Admin Funktion) |
@ -1155,7 +1156,7 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet:
|---------------------+--------------------------------| |---------------------+--------------------------------|
| *Preconditions* | Account mit Administrationsrechten vorhanden. | | *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. | | *Normal Flow* | 1. Der Administrator loggt sich unter https://didgeridoo.ml/admin ein. |
| | 2. Admin klickt neben "Articles" auf "+ Add". | | | 2. Admin klickt neben "Articles" auf "+ Add". |
@ -1174,6 +1175,7 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet:
| *Notes* | - | | *Notes* | - |
|---------------------+--------------------------------| |---------------------+--------------------------------|
| *UC History* | 1.0 Darft erstellt durch AZ | | *UC History* | 1.0 Darft erstellt durch AZ |
| | 1.1 AZ Rechtschreibung korrigiert |
|---------------------+--------------------------------| |---------------------+--------------------------------|
| *Author* | A. Zweili & I. Hörler | | *Author* | A. Zweili & I. Hörler |
|---------------------+--------------------------------| |---------------------+--------------------------------|
@ -1181,6 +1183,48 @@ aus, die Use Cases mit den Nummern wurden dabei im Detail ausgearbeitet:
|---------------------+--------------------------------| |---------------------+--------------------------------|
#+LATEX:} #+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 ***** max_pictures Option anpassen
#+LATEX:{\footnotesize #+LATEX:{\footnotesize
@ -1592,32 +1636,35 @@ die Datenbank mit zusätzlichen Anfragen belastet werden kann.
*** Frontend Umsetzung *** Frontend Umsetzung
Die Umsetztung des Frontends mittels Django integrierter Template Die Umsetztung des Frontends mittels Django integrierter Template
funktionen sind geprägt vom einstmalig eigenständigen Jinja Template Funktionen sind geprägt vom einstmalig eigenständigen Jinja Template
framework das auch in Python programmiert wurde. Mittlerweile ist es Framework das auch in Python programmiert wurde. Mittlerweile ist es
integrierter bestandteil vom django Framework. integrierter Bestandteil vom Django Framework. Dieses Snippet erklärt
Dieses snipet erklärt deren Nutzung: deren Nutzung:
#+CAPTION: jinja Code Block
#+BEGIN_SRC python #+BEGIN_EXPORT latex
\begin{sexylisting}{Jinja Code Block}
{% extends 'base.html' %} --> Dieser codeblock wird im base.html eingefügt. {% extends 'base.html' %} --> Dieser codeblock wird im base.html eingefügt.
{% block title %}Memberlist{% endblock %} --> Titel wird in den tag {% block title %}Memberlist{% endblock %} --> Titel wird in den tag
title eingefügt. title eingefügt.
{% block content %} --> wird in den block mit dem tag ''content'' eingefügt. {% block content %} --> wird in den block mit dem tag ''content'' eingefügt.
<ul> --> standard unordered List item von HTML. <ul> --> standard unordered List item von HTML.
{% for user in users %} --> schleifenkopf {% for user in users %} --> schleifenkopf
<li> <li>
<a href="{{ user.url }}">{{ user.username }}</a> --> für <a href="{{ user.url }}">{{ user.username }}</a> --> für
jeden Benutzer wird eine listitem erstellt und der Username als text eingefügt. jeden Benutzer wird eine listitem erstellt und der Username als text eingefügt.
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endblock %} {% endblock %}
#+END_SRC \end{sexylisting}
#+END_EXPORT
*** Backend Umsetzung *** 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 Datenbank gleich selbst regelt. Dadurch lässt sich backendseitig
durchgängig in Python arbeiten. durchgängig in Python arbeiten. Die Umsetzung gliedert sich
Die Umsetzung gliedert sich vereinfacht in 3 Bereiche: vereinfacht in 3 Bereiche:
1. Einem Frontend dass für den Benutzer gemacht ist und das mehrere 1. Einem Frontend dass für den Benutzer gemacht ist und das mehrere
submodule wie Cathegories oder Wahrenkorb beinhaltet. submodule wie Cathegories oder Wahrenkorb beinhaltet.
2. Ein Backend welches zum Bearbeiten/Erstellen von Produkten dient. 2. Ein Backend welches zum Bearbeiten/Erstellen von Produkten dient.
@ -1625,7 +1672,29 @@ Die Umsetzung gliedert sich vereinfacht in 3 Bereiche:
** Testing ** 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:\newpage
#+LATEX:\begin{landscape} #+LATEX:\begin{landscape}