@@ -1,24 +1,28 @@ | |||
from django.contrib import admin | |||
from django.contrib.auth import get_user_model | |||
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin | |||
from django.contrib.auth.models import User | |||
from .models import Post, CustomUser | |||
#external code customised | |||
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model | |||
class CustomUserInline(admin.StackedInline): | |||
model = CustomUser | |||
can_delete = False | |||
verbose_name_plural = 'customUsers' | |||
#external code customised | |||
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model | |||
# Define a new User admin | |||
class UserAdmin(BaseUserAdmin): | |||
inlines = (CustomUserInline, ) | |||
#external code customised | |||
#import from https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model | |||
# Re-register UserAdmin | |||
admin.site.unregister(User) | |||
admin.site.register(User, UserAdmin) | |||
admin.site.register(Post) | |||
@@ -3,15 +3,21 @@ from datetime import datetime | |||
from .models import Post, CustomUser | |||
from django.forms import ModelForm, ValidationError | |||
from taggit.forms import * | |||
#extended code customised | |||
#import from https://tutorial.djangogirls.org/en/django_forms/ | |||
class PostForm(forms.ModelForm): | |||
class Meta: | |||
model = Post | |||
fields = ('title', 'text', 'published_date','tags') | |||
class NewTagForm(forms.ModelForm): | |||
tags = TagField() | |||
class Meta: | |||
model = CustomUser | |||
fields = ['tags'] |
@@ -2,11 +2,14 @@ from django.conf import settings | |||
from django.conf.urls import url | |||
from django.conf.urls import include | |||
from django.urls import path | |||
from taggit_templatetags2 import urls as taggit_templatetags2_urls | |||
from . import views | |||
from taggit_templatetags2 import urls as taggit_templatetags2_urls | |||
import debug_toolbar | |||
urlpatterns = [ | |||
url(r'^$', views.tag_list, name='tag_list'), | |||
url(r'^tag/(?P<slug>[-\w]+)/$', views.post_list, name='post_list_by_tag'), | |||
@@ -22,6 +25,9 @@ urlpatterns = [ | |||
url(r'^tags/', include('taggit_templatetags2.urls')), | |||
] | |||
#external code | |||
#import from https://django-debug-toolbar.readthedocs.io/en/latest/installation.html | |||
if settings.DEBUG: | |||
import debug_toolbar | |||
urlpatterns += [ |
@@ -124,17 +124,6 @@ def post_remove(request, pk): | |||
return redirect('post_list') | |||
""" @login_required | |||
def tag_remove(request, slug=None): | |||
log = logging.getLogger('mysite') | |||
user_instance = get_object_or_404(CustomUser, user=request.user) | |||
tag = Tag.get_object_or_404(Tag, slug = slug) | |||
log.info(tag) | |||
if slug: | |||
user_instance.tags.remove(tag) | |||
save_m2m() | |||
return redirect('student_page') """ | |||
@login_required | |||
def tag_list(request): | |||
log = logging.getLogger('mysite') |
@@ -1 +0,0 @@ | |||
Subproject commit 3273cbc777423138f9b6cfb127de503b63ccd22f |
@@ -37,26 +37,22 @@ | |||
\bibdata{references/References_2} | |||
\bibcite{Bootstrap}{{BA11}{}{{}}{{}}} | |||
\bibcite{Computer}{{Com18}{}{{}}{{}}} | |||
\bibcite{Oracle}{{Coo10}{}{{}}{{}}} | |||
\bibcite{Dixit}{{Dix18}{}{{}}{{}}} | |||
\bibcite{Djangogirls}{{Dja18a}{}{{}}{{}}} | |||
\bibcite{Djangogirls-2}{{Dja18b}{}{{}}{{}}} | |||
\bibcite{Moodle}{{Dok15}{}{{}}{{}}} | |||
\bibcite{Moodle-2}{{Dok18}{}{{}}{{}}} | |||
\bibcite{Fiok}{{Fio14}{}{{}}{{}}} | |||
\bibcite{Schlede}{{FMS17}{}{{}}{{}}} | |||
\bibcite{Django-4}{{Fou18a}{}{{}}{{}}} | |||
\bibcite{Django}{{Fou18b}{}{{}}{{}}} | |||
\@writefile{toc}{\contentsline {chapter}{Referenzen}{35}{chapter*.25}} | |||
\bibcite{Django-2}{{Fou18c}{}{{}}{{}}} | |||
\bibcite{Django-3}{{Fou18d}{}{{}}{{}}} | |||
\bibcite{Python}{{Fou18e}{}{{}}{{}}} | |||
\@writefile{toc}{\contentsline {chapter}{Referenzen}{35}{chapter*.25}} | |||
\bibcite{Gaynor}{{Gay10}{}{{}}{{}}} | |||
\bibcite{Sario}{{Gmb18}{}{{}}{{}}} | |||
\bibcite{Herzog}{{Her16}{}{{}}{{}}} | |||
\bibcite{King}{{Kin17}{}{{}}{{}}} | |||
\bibcite{Leipner}{{Lei13}{}{{}}{{}}} | |||
\bibcite{Microsoft}{{Mic18}{}{{}}{{}}} | |||
\bibcite{Ndukwe}{{Ndu17}{}{{}}{{}}} | |||
\bibcite{Nevius}{{Nev15}{}{{}}{{}}} | |||
\bibcite{Ong}{{Ong18}{}{{}}{{}}} |
@@ -12,19 +12,6 @@ The Computer~Language Company. | |||
\newblock 2018. | |||
\newblock https://www.pcmag.com/encyclopedia/term/58231/user-permissions. | |||
\bibitem[Coo10]{Oracle} | |||
Oracle Cooperation. | |||
\newblock About ldap. | |||
\newblock 2010. | |||
\newblock https://docs.oracle.com/cd/E19182-01/820-6573/6nht2e5a4/index.html. | |||
\bibitem[Dix18]{Dixit} | |||
Chitrank Dixit. | |||
\newblock Pep-8 tutorial: Code standards in python. | |||
\newblock 2018. | |||
\newblock | |||
https://www.datacamp.com/community/tutorials/pep8-tutorial-python-code. | |||
\bibitem[Dja18a]{Djangogirls} | |||
Djangogirls. | |||
\newblock Creating a blog post model. | |||
@@ -56,13 +43,6 @@ Marzena Fiok. | |||
\newblock | |||
https://www.tecchannel.de/a/e-mail-flut-sorgt-fuer-kostenlawine,402338,3. | |||
\bibitem[FMS17]{Schlede} | |||
Andreas~Donner Frank-Michael~Schlede, Thomas~Bär. | |||
\newblock Was ist ldap (lightweight directory access protocol)? | |||
\newblock 2017. | |||
\newblock | |||
https://www.ip-insider.de/was-ist-ldap-lightweight-directory-access-protocol-a-581204/. | |||
\bibitem[Fou18a]{Django-4} | |||
Django~Software Foundation. | |||
\newblock Cross site request forgery protection. | |||
@@ -130,12 +110,6 @@ Ingo Leipner. | |||
\newblock | |||
http://www.mz-web.de/wirtschaft/e-mail-flut-mails-bearbeiten-kommunikation-stress-zeit-sparen. | |||
\bibitem[Mic18]{Microsoft} | |||
Microsoft. | |||
\newblock Extensions for the visual studio family of products. | |||
\newblock 2018. | |||
\newblock https://marketplace.visualstudio.com/. | |||
\bibitem[Ndu17]{Ndukwe} | |||
Nnenna Ndukwe. | |||
\newblock Python is the back-end programming language of the future and |
@@ -11,20 +11,17 @@ A level-1 auxiliary file: chapters/ausblick.aux | |||
A level-1 auxiliary file: chapters/fazit.aux | |||
The style file: alpha.bst | |||
Database file #1: ../references/References_2.bib | |||
Repeated entry---line 204 of file ../references/References_2.bib | |||
Repeated entry---line 176 of file ../references/References_2.bib | |||
: @article{Djangogirls-2 | |||
: , | |||
I'm skipping whatever remains of this entry | |||
Warning--empty journal in Bootstrap | |||
Warning--empty journal in Computer | |||
Warning--empty journal in Oracle | |||
Warning--empty journal in Dixit | |||
Warning--empty journal in Djangogirls | |||
Warning--empty journal in Djangogirls-2 | |||
Warning--empty journal in Moodle | |||
Warning--empty journal in Moodle-2 | |||
Warning--empty journal in Fiok | |||
Warning--empty journal in Schlede | |||
Warning--empty journal in Django-4 | |||
Warning--empty journal in Django | |||
Warning--empty journal in Django-2 | |||
@@ -35,7 +32,6 @@ Warning--empty journal in Sario | |||
Warning--empty journal in Herzog | |||
Warning--empty journal in King | |||
Warning--empty journal in Leipner | |||
Warning--empty journal in Microsoft | |||
Warning--empty journal in Ndukwe | |||
Warning--empty journal in Nevius | |||
Warning--empty journal in Ong | |||
@@ -46,45 +42,45 @@ Warning--empty journal in Shelest | |||
Warning--empty journal in Solutions | |||
Warning--empty journal in Timm | |||
Warning--empty publisher in Weigend | |||
You've used 31 entries, | |||
You've used 27 entries, | |||
2543 wiz_defined-function locations, | |||
721 strings with 8688 characters, | |||
and the built_in function-call counts, 8440 in all, are: | |||
= -- 834 | |||
> -- 248 | |||
< -- 31 | |||
+ -- 67 | |||
- -- 62 | |||
* -- 407 | |||
:= -- 1475 | |||
add.period$ -- 124 | |||
call.type$ -- 31 | |||
change.case$ -- 154 | |||
chr.to.int$ -- 26 | |||
cite$ -- 62 | |||
duplicate$ -- 436 | |||
empty$ -- 626 | |||
format.name$ -- 122 | |||
if$ -- 1648 | |||
702 strings with 8139 characters, | |||
and the built_in function-call counts, 7358 in all, are: | |||
= -- 726 | |||
> -- 216 | |||
< -- 27 | |||
+ -- 59 | |||
- -- 54 | |||
* -- 355 | |||
:= -- 1287 | |||
add.period$ -- 108 | |||
call.type$ -- 27 | |||
change.case$ -- 134 | |||
chr.to.int$ -- 22 | |||
cite$ -- 54 | |||
duplicate$ -- 380 | |||
empty$ -- 546 | |||
format.name$ -- 107 | |||
if$ -- 1436 | |||
int.to.chr$ -- 6 | |||
int.to.str$ -- 0 | |||
missing$ -- 32 | |||
newline$ -- 189 | |||
num.names$ -- 93 | |||
pop$ -- 187 | |||
missing$ -- 28 | |||
newline$ -- 165 | |||
num.names$ -- 81 | |||
pop$ -- 164 | |||
preamble$ -- 1 | |||
purify$ -- 186 | |||
purify$ -- 162 | |||
quote$ -- 0 | |||
skip$ -- 336 | |||
skip$ -- 291 | |||
stack$ -- 0 | |||
substring$ -- 217 | |||
substring$ -- 189 | |||
swap$ -- 1 | |||
text.length$ -- 31 | |||
text.prefix$ -- 29 | |||
text.length$ -- 27 | |||
text.prefix$ -- 26 | |||
top$ -- 0 | |||
type$ -- 244 | |||
warning$ -- 31 | |||
while$ -- 62 | |||
width$ -- 37 | |||
write$ -- 405 | |||
type$ -- 212 | |||
warning$ -- 27 | |||
while$ -- 54 | |||
width$ -- 33 | |||
write$ -- 353 | |||
(There was 1 error message) |
@@ -1,4 +1,4 @@ | |||
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex 2018.6.7) 7 DEC 2018 20:38 | |||
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex 2018.6.7) 9 DEC 2018 11:03 | |||
entering extended mode | |||
\write18 enabled. | |||
file:line:error style messages enabled. | |||
@@ -2247,37 +2247,42 @@ Underfull \hbox (badness 4316) in paragraph at lines 4--8 | |||
Underfull \hbox (badness 10000) in paragraph at lines 16--20 | |||
[]\T1/aer/m/n/12 Oracle Coope-ra-ti-on. About ldap. 2010. | |||
[]\T1/aer/m/n/12 Djangogirls. Crea-ting a blog post mo-del. 2018. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 22--27 | |||
\T1/aer/m/n/12 https://www.datacamp.com/community/tutorials/pep8-tutorial-python- | |||
Underfull \hbox (badness 10000) in paragraph at lines 28--32 | |||
[]\T1/aer/m/n/12 Moodle Do-ku-men-ta-ti-on. Auf-bau ei-ner moodle-site. 2015. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 29--33 | |||
[]\T1/aer/m/n/12 Djangogirls. Crea-ting a blog post mo-del. 2018. | |||
Underfull \hbox (badness 10000) in paragraph at lines 34--38 | |||
[]\T1/aer/m/n/12 Moodle Do-ku-men-ta-ti-on. Cron-job. 2018. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 41--45 | |||
[]\T1/aer/m/n/12 Moodle Do-ku-men-ta-ti-on. Auf-bau ei-ner moodle-site. 2015. | |||
Underfull \hbox (badness 10000) in paragraph at lines 40--45 | |||
[]\T1/aer/m/n/12 Marzena Fiok. E-mail-flut sorgt für ko-sten-la-wi-ne. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 47--51 | |||
[]\T1/aer/m/n/12 Moodle Do-ku-men-ta-ti-on. Cron-job. 2018. | |||
Underfull \hbox (badness 10000) in paragraph at lines 40--45 | |||
\T1/aer/m/n/12 2014. https://www.tecchannel.de/a/e-mail-flut-sorgt-fuer- | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 53--58 | |||
[]\T1/aer/m/n/12 Marzena Fiok. E-mail-flut sorgt für ko-sten-la-wi-ne. | |||
Underfull \hbox (badness 10000) in paragraph at lines 59--64 | |||
\T1/aer/m/n/12 https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the- | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 53--58 | |||
\T1/aer/m/n/12 2014. https://www.tecchannel.de/a/e-mail-flut-sorgt-fuer- | |||
Underfull \hbox (badness 8056) in paragraph at lines 66--71 | |||
[]\T1/aer/m/n/12 Django Soft-ware Foun-da-ti-on. Working with forms. 2018. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 66--71 | |||
\T1/aer/m/n/12 https://docs.djangoproject.com/en/dev/topics/forms/#using-a-form- | |||
[] | |||
Package babel Info: Redefining german shorthand "f | |||
@@ -2297,28 +2302,14 @@ Package babel Info: Redefining german shorthand "~ | |||
] | |||
Underfull \hbox (badness 10000) in paragraph at lines 79--84 | |||
\T1/aer/m/n/12 https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the- | |||
[] | |||
Underfull \hbox (badness 8056) in paragraph at lines 86--91 | |||
[]\T1/aer/m/n/12 Django Soft-ware Foun-da-ti-on. Working with forms. 2018. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 86--91 | |||
\T1/aer/m/n/12 https://docs.djangoproject.com/en/dev/topics/forms/#using-a-form- | |||
[] | |||
Missing character: There is no ’ in font aer12! | |||
Underfull \hbox (badness 10000) in paragraph at lines 105--109 | |||
Underfull \hbox (badness 10000) in paragraph at lines 85--89 | |||
[]\T1/aer/m/n/12 Sario Mar-ke-ting GmbH. Tag-ging. 2018. | |||
[] | |||
Underfull \hbox (badness 2717) in paragraph at lines 119--124 | |||
Underfull \hbox (badness 2717) in paragraph at lines 99--104 | |||
[]\T1/aer/m/n/12 Adam King. Djan-go midd-le-wa-res and the re-quest/-re-spon-se cy- | |||
[] | |||
@@ -2327,79 +2318,79 @@ Missing character: There is no ̈ in font aer12! | |||
Missing character: There is no ̈ in font aer12! | |||
Missing character: There is no ’ in font aer12! | |||
Underfull \hbox (badness 10000) in paragraph at lines 140--146 | |||
Underfull \hbox (badness 10000) in paragraph at lines 114--120 | |||
\T1/aer/m/n/12 medium-com-nnennandukwe-python-is-the-back-end-programming- | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 148--152 | |||
Underfull \hbox (badness 10000) in paragraph at lines 122--126 | |||
[]\T1/aer/m/n/12 Ryan Ne-vi-us. django-post_office git re-po-si-to-ry. 2015. | |||
[] | |||
Package Fancyhdr Warning: \headheight is too small (12.0pt): | |||
Make it at least 14.49998pt. | |||
We now make it that large for the rest of the document. | |||
This may cause the page layout to be inconsistent, however. | |||
Package babel Info: Redefining german shorthand "f | |||
(babel) in language on input line 153. | |||
Package babel Info: Redefining german shorthand "| | |||
(babel) in language on input line 153. | |||
Package babel Info: Redefining german shorthand "~ | |||
(babel) in language on input line 153. | |||
Package babel Info: Redefining german shorthand "f | |||
(babel) in language on input line 153. | |||
Package babel Info: Redefining german shorthand "| | |||
(babel) in language on input line 153. | |||
Package babel Info: Redefining german shorthand "~ | |||
(babel) in language on input line 153. | |||
[36] | |||
Underfull \hbox (badness 10000) in paragraph at lines 154--158 | |||
Underfull \hbox (badness 10000) in paragraph at lines 128--132 | |||
[]\T1/aer/m/n/12 Selwin Ong. Djan-go request-response cy-cle. 2018. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 160--165 | |||
Underfull \hbox (badness 10000) in paragraph at lines 134--139 | |||
[]\T1/aer/m/n/12 Mark Ot-to. Boot-strap from twit-ter. 2011. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 160--165 | |||
Underfull \hbox (badness 10000) in paragraph at lines 134--139 | |||
\T1/aer/m/n/12 https://blog.twitter.com/developer/en_us/a/2011/bootstrap- | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 167--172 | |||
Underfull \hbox (badness 10000) in paragraph at lines 141--146 | |||
[]\T1/aer/m/n/12 Mark Ot-to. Say hel-lo to boot-strap 2.0. 2012. | |||
[] | |||
Overfull \hbox (38.1438pt too wide) in paragraph at lines 167--172 | |||
Overfull \hbox (38.1438pt too wide) in paragraph at lines 141--146 | |||
\T1/aer/m/n/12 https://web.archive.org/web/20120203191214/https://dev.twitter.com/blog/say- | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 174--178 | |||
Underfull \hbox (badness 10000) in paragraph at lines 148--152 | |||
[]\T1/aer/m/n/12 Shabda. Un-der-stan-ding de-co-ra-tors. 2009. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 180--186 | |||
Underfull \hbox (badness 10000) in paragraph at lines 154--160 | |||
[]\T1/aer/m/n/12 Alexy She-lest. Mo-del view con-trol-ler, mo-del view pre- | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 180--186 | |||
Underfull \hbox (badness 10000) in paragraph at lines 154--160 | |||
\T1/aer/m/n/12 sen-ter, and mo-del view view-mo-del de-sign pat-terns. 2009. | |||
[] | |||
Underfull \hbox (badness 10000) in paragraph at lines 180--186 | |||
Underfull \hbox (badness 10000) in paragraph at lines 154--160 | |||
\T1/aer/m/n/12 https://www.codeproject.com/Articles/42830/Model-View-Controller- | |||
[] | |||
) | |||
Package Fancyhdr Warning: \headheight is too small (12.0pt): | |||
Make it at least 14.49998pt. | |||
We now make it that large for the rest of the document. | |||
This may cause the page layout to be inconsistent, however. | |||
Package babel Info: Redefining german shorthand "f | |||
(babel) in language on input line 160. | |||
Package babel Info: Redefining german shorthand "| | |||
(babel) in language on input line 160. | |||
Package babel Info: Redefining german shorthand "~ | |||
(babel) in language on input line 160. | |||
Package babel Info: Redefining german shorthand "f | |||
(babel) in language on input line 160. | |||
Package babel Info: Redefining german shorthand "| | |||
(babel) in language on input line 160. | |||
Package babel Info: Redefining german shorthand "~ | |||
(babel) in language on input line 160. | |||
[36]) | |||
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 78. | |||
@@ -2435,10 +2426,10 @@ Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 78. | |||
) | |||
(\end occurred when \ifnum on line 5 was incomplete) | |||
Here is how much of TeX's memory you used: | |||
27414 strings out of 492970 | |||
490166 string characters out of 6133939 | |||
562518 words of memory out of 5000000 | |||
30995 multiletter control sequences out of 15000+600000 | |||
27402 strings out of 492970 | |||
489989 string characters out of 6133939 | |||
562442 words of memory out of 5000000 | |||
30983 multiletter control sequences out of 15000+600000 | |||
559401 words of font info for 77 fonts, out of 8000000 for 9000 | |||
1348 hyphenation exceptions out of 8191 | |||
44i,18n,50p,10437b,951s stack positions out of 5000i,500n,10000p,200000b,80000s |
@@ -119,7 +119,7 @@ Das \texttt{+} in der Menüleiste leitet den Benutzer zu einer Unterseite. Hier | |||
Speichert der Benutzer den Artikel, so werden im Backend die Daten wie folgt verarbeitet. In der View \texttt{post\_new} wird zunächst geprüft, ob alle Eingaben valide sind. Falls dies der Fall ist, wird der jeweilige Beitrag als Objekt zurückgegeben, jedoch durch das optionale Keywort \texttt{commit=false} noch nicht in der Datenbank gespeichert. Das ist notwendig, um dem Objekt spezifische Informationen mitzugeben. In diesem Kontext wird der aktuell eingeloggte User als Autor hinterlegt. Jedoch birgt die Vorgehensweise eine Problematik im Speichervorgang einer \texttt{ManyToMany} Relation zwischen zwei Modellen. Da Informationen nur auf ein bereits in der Datenbank bestehendes Objekt gesichert werden können, ist dies zunächst nicht möglich (vgl. [Fou18b]). | |||
Im Prototyp nutzt das \texttt{PostModel} die \texttt{ManyToMany} Konnektivität mit dem Modell des \texttt{TaggabelManagers}. Um die Eingabe des Tag-Felds trotzdem im neuen Artikel speichern zu können, wird zunächst das Objekt gespeichert, um danach explizit das von Django zur Verfügung gestellte \texttt{form.save\_m2m()} aufrufen zu können. Der Befehl zwingt die Daten der \texttt{ManyToMany} Relation zu speichern. | |||
Die eindeutige Zuordnung der Eingabe im Front-end zur Verarbeitung der Artikel im Back-end ist mit einem \texttt{Primary Key} realisiert. Das \texttt{PostModel} bekommt beim Anlegen keinen Schlüssel zu einem Feld zugewiesen. Django erstellt ihn automatisiert beim Speichern der Tabelle als \texttt{AutoField} im Feld \texttt{Id} und identifiziert die \texttt{Id} automatisch bei jedem neu Erstellen eines Objekts. Somit sind alle Objekte eindeutig zuordenbar und können mit dem Kommando \texttt{post.pk} jederzeit abgefragt werden. | |||
Die eindeutige Zuordnung der Eingabe im Frontend zur Verarbeitung der Artikel im Backend ist mit einem \texttt{Primary Key} realisiert. Das \texttt{PostModel} bekommt beim Anlegen keinen Schlüssel zu einem Feld zugewiesen. Django erstellt ihn automatisiert beim Speichern der Tabelle als \texttt{AutoField} im Feld \texttt{Id} und identifiziert die \texttt{Id} automatisch bei jedem neu Erstellen eines Objekts. Somit sind alle Objekte eindeutig zuordenbar und können mit dem Kommando \texttt{post.pk} jederzeit abgefragt werden. | |||
\\ | |||
\\ | |||
\textbf{Einen bereits vorhandenen Artikel löschen: } | |||
@@ -138,7 +138,7 @@ In der Detailansicht eines Artikels ist es möglich, denselben zu entfernen. Die | |||
\hfill | |||
\end{figure} | |||
Veranlasst der Benutzer die Speicherung des Artikels im Front-end, wird die bedingte Abfrage der Abbildung 3.7. in Zeile 91 erfüllt. Die POST-Abfrage ist hier notwendig, da Django nur so Daten in der Datenbank verändert. Eine Begründung hierfür ist die Art der Übertragung der Daten an den Server. \texttt{POST-Requests} bündeln alle Daten, verschlüsseln sie und senden sie dann an der Server (vgl. [Fou18c]). Dadurch ist der Vorgang einfacher kontrollierbar und mit einem \texttt{csrf-Token} im Template ebenfalls gegen Cross-Site-Request-Fälschung abgesichert. Die weitere Vorgehensweise der Funktion ist identisch zum bereits dargelegten neu erstellen eines Artikels und muss nicht weiter beschrieben werden.\\ | |||
Veranlasst der Benutzer die Speicherung des Artikels im Frontend, wird die bedingte Abfrage der Abbildung 3.7. in Zeile 91 erfüllt. Die POST-Abfrage ist hier notwendig, da Django nur so Daten in der Datenbank verändert. Eine Begründung hierfür ist die Art der Übertragung der Daten an den Server. \texttt{POST-Requests} bündeln alle Daten, verschlüsseln sie und senden sie dann an der Server (vgl. [Fou18c]). Dadurch ist der Vorgang einfacher kontrollierbar und mit einem \texttt{csrf-Token} im Template ebenfalls gegen Cross-Site-Request-Fälschung abgesichert. Die weitere Vorgehensweise der Funktion ist identisch zum bereits dargelegten neu erstellen eines Artikels und muss nicht weiter beschrieben werden.\\ | |||
\begin{figure}[!h] | |||
\centering |
@@ -47,13 +47,6 @@ | |||
note = "https://docs.python.org/3/tutorial/venv.html" | |||
} | |||
@article{Dixit, | |||
author = "Chitrank Dixit", | |||
title = "PEP-8 Tutorial: Code Standards in Python", | |||
year = "2018", | |||
note = "https://www.datacamp.com/community/tutorials/pep8-tutorial-python-code" | |||
} | |||
@article{Shabda, | |||
author = "Shabda", | |||
title = "Understanding decorators", | |||
@@ -96,20 +89,6 @@ | |||
note = "Kapitel 23.1" | |||
} | |||
@article{Schlede, | |||
author = "Frank-Michael Schlede, Thomas Bär, Andreas Donner", | |||
title = "Was ist LDAP (Lightweight Directory Access Protocol)?", | |||
year = "2017", | |||
note = "https://www.ip-insider.de/was-ist-ldap-lightweight-directory-access-protocol-a-581204/" | |||
} | |||
@article{Oracle, | |||
author = "Oracle Cooperation", | |||
title = "About LDAP", | |||
year = "2010", | |||
note = "https://docs.oracle.com/cd/E19182-01/820-6573/6nht2e5a4/index.html" | |||
} | |||
@article{Otto, | |||
author = "Mark Otto", | |||
title = "Bootstrap from Twitter", | |||
@@ -152,13 +131,6 @@ | |||
note = "https://djangogirls.org/" | |||
} | |||
@article{Microsoft, | |||
author = "Microsoft", | |||
title = "Extensions for the Visual Studio family of products", | |||
year = "2018", | |||
note = "https://marketplace.visualstudio.com/" | |||
} | |||
@article{Computer, | |||
author = "The Computer Language Company", | |||
title = "Definition of: user permissions", |