diff --git a/application/templates/blog_search_list_view.html b/application/templates/blog_search_list_view.html
index 588136d..d815d37 100644
--- a/application/templates/blog_search_list_view.html
+++ b/application/templates/blog_search_list_view.html
@@ -2,9 +2,21 @@
{% load taggit_templatetags2_tags %}
{% get_tagcloud as tags for 'application' %}
{% include_tagcloud 'application.Post' %}
+
+
+
+{% if messages %}
+{% for message in messages %}
+
{{ message }}
+{% endfor %}
+{% endif %}
+
{% for post in posts %}
diff --git a/application/urls.py b/application/urls.py
index 7a51ca4..6004e8c 100644
--- a/application/urls.py
+++ b/application/urls.py
@@ -11,7 +11,6 @@ urlpatterns = [
url(r'^$', views.post_list, name='post_list'),
url(r'^tag/(?P
[-\w]+)/$', views.post_list, name='post_list_by_tag'),
url(r'^taglist/$', views.tag_list, name='tag_list'),
- url(r'^student/', views.student_page, name='student_page'),
url(r'^search/', views.blog_search_list_view, name='blog_search_list_view'),
url(r'^search/result/$', views.blog_search_list_view, name='post_list_by_search'),
url(r'^post/(?P\d+)/$', views.post_detail, name='post_detail'),
@@ -20,10 +19,13 @@ urlpatterns = [
url(r'^drafts/$', views.post_draft_list, name='post_draft_list'),
url(r'^post/(?P\d+)/publish/$', views.post_publish, name='post_publish'),
url(r'^post/(?P\d+)/remove/$', views.post_remove, name='post_remove'),
- url(r'^student/(?P[-\w]+)/remove/$', views.tag_remove, name='tag_remove'),
url(r'^tags/', include('taggit_templatetags2.urls')),
]
+"""
+ url(r'^student/(?P[-\w]+)/remove/$', views.tag_remove, name='tag_remove'),
+ """
+
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
diff --git a/application/views.py b/application/views.py
index 6126606..56f0e93 100644
--- a/application/views.py
+++ b/application/views.py
@@ -126,47 +126,16 @@ def post_remove(request, pk):
return redirect('post_list')
-@login_required
+""" @login_required
def tag_remove(request, slug=None):
log = logging.getLogger('mysite')
user_instance = get_object_or_404(CustomUser, user=request.user)
- log.info(u)
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 student_page(request):
- log = logging.getLogger('mysite')
- user_instance = get_object_or_404(CustomUser, user=request.user)
- if request.method == "POST":
- log.info('post method')
- form = NewTagForm(request.POST, instance=user_instance)
- if form.is_valid():
- log.info('form is valid')
- obj = form.save(commit=False)
- obj.user = request.user
- obj.save()
- tag_names = [tag.name for tag in Tag.objects.all()]
- log.info(tag_names)
- m_tags = form.cleaned_data['tags']
- m_tags = ' '.join(str(m_tags) for m_tags in m_tags)
- log.info(m_tags)
- if m_tags in tag_names:
- log.info('worked out')
- obj.tags.add(m_tags)
- form.save_m2m()
- messages.info(request, 'Der Tag "' + m_tags + '" wurde gespeichert')
- return redirect('/student/')
- else:
- messages.info(request, 'Sorry !! Den Tag den du suchst gibt es leider nicht!')
- else:
- form = NewTagForm()
- return render(request, 'student_page.html', {'form':form})
+ return redirect('student_page') """
@login_required
def tag_list(request):
@@ -187,11 +156,32 @@ def blog_search_list_view(request):
search_query = request.GET.get('search_box', None)
log.info(search_query)
posts = posts.filter(tags__name__in=[search_query])
+ log = logging.getLogger('mysite')
+ user_instance = get_object_or_404(CustomUser, user=request.user)
+ if request.method == "POST":
+ log.info('post method')
+ form = NewTagForm(request.POST, instance=user_instance)
+ if form.is_valid():
+ log.info('form is valid')
+ obj = form.save(commit=False)
+ obj.user = request.user
+ tag_names = [tag.name for tag in Tag.objects.all()]
+ log.info(tag_names)
+ m_tags = form.cleaned_data['tags']
+ m_tags = ' '.join(str(m_tags) for m_tags in m_tags)
+ log.info(m_tags)
+ if m_tags in tag_names:
+ log.info('worked out')
+ obj.tags.add(m_tags)
+ obj.save()
+ messages.info(request, 'Der Tag "' + m_tags + '" wurde gespeichert')
+ return redirect('/search/')
+ else:
+ messages.info(request, 'Sorry !! Den Tag den du suchst gibt es leider nicht!')
+ else:
+ form = NewTagForm()
return render(request, 'blog_search_list_view.html', locals())
-def tag_cloud(request):
- return render(request, 'tag_cloud.html', {})
-
mail.send(
'kleinhenz.e@gmail.com', # List of email addresses also accepted
'esther.kleinhenz@web.de',
diff --git a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.aux b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.aux
index 56db00c..7f18102 100644
--- a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.aux
+++ b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.aux
@@ -43,10 +43,11 @@
\bibcite{Schlede}{{FMS17}{}{{}}{{}}}
\bibcite{Django}{{Fou18a}{}{{}}{{}}}
\bibcite{Django-2}{{Fou18b}{}{{}}{{}}}
-\bibcite{Python}{{Fou18c}{}{{}}{{}}}
+\bibcite{Django-3}{{Fou18c}{}{{}}{{}}}
+\bibcite{Python}{{Fou18d}{}{{}}{{}}}
\bibcite{Gaynor}{{Gay10}{}{{}}{{}}}
+\@writefile{toc}{\contentsline {chapter}{Referenzen}{24}{chapter*.16}}
\bibcite{Herzog}{{Her16}{}{{}}{{}}}
-\@writefile{toc}{\contentsline {chapter}{Referenzen}{23}{chapter*.16}}
\bibcite{King}{{Kin17}{}{{}}{{}}}
\bibcite{Leipner}{{Lei13}{}{{}}{{}}}
\bibcite{Microsoft}{{Mic18}{}{{}}{{}}}
diff --git a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.bbl b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.bbl
index 5665abd..8fe41f3 100644
--- a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.bbl
+++ b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.bbl
@@ -1,4 +1,4 @@
-\begin{thebibliography}{Fou18b}
+\begin{thebibliography}{Fou18d}
\bibitem[BA11]{Bootstrap}
Twitter~Inc Bootstrap~Authors.
@@ -51,7 +51,14 @@ Django~Software Foundation.
\newblock
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/\#the-save-method.
-\bibitem[Fou18c]{Python}
+\bibitem[Fou18c]{Django-3}
+Django~Software Foundation.
+\newblock Working with forms.
+\newblock 2018.
+\newblock
+ https://docs.djangoproject.com/en/dev/topics/forms/\#using-a-form-in-a-view.
+
+\bibitem[Fou18d]{Python}
Python~Software Foundation.
\newblock Virtual environments and packages.
\newblock 2018.
diff --git a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.blg b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.blg
index c7ad9c0..24709c5 100644
--- a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.blg
+++ b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.blg
@@ -23,6 +23,7 @@ Warning--empty journal in Djangogirls
Warning--empty journal in Schlede
Warning--empty journal in Django
Warning--empty journal in Django-2
+Warning--empty journal in Django-3
Warning--empty journal in Python
Warning--empty journal in Gaynor
Warning--empty journal in Herzog
@@ -38,45 +39,45 @@ Warning--empty journal in Shelest
Warning--empty journal in Solutions
Warning--empty journal in Timm
Warning--empty publisher in Weigend
-You've used 23 entries,
+You've used 24 entries,
2543 wiz_defined-function locations,
- 684 strings with 7930 characters,
-and the built_in function-call counts, 6272 in all, are:
-= -- 618
-> -- 184
-< -- 23
-+ -- 48
-- -- 46
-* -- 303
-:= -- 1101
-add.period$ -- 92
-call.type$ -- 23
-change.case$ -- 114
+ 688 strings with 8039 characters,
+and the built_in function-call counts, 6541 in all, are:
+= -- 645
+> -- 192
+< -- 24
++ -- 51
+- -- 48
+* -- 316
+:= -- 1145
+add.period$ -- 96
+call.type$ -- 24
+change.case$ -- 119
chr.to.int$ -- 21
-cite$ -- 46
-duplicate$ -- 324
-empty$ -- 466
-format.name$ -- 90
-if$ -- 1224
-int.to.chr$ -- 3
+cite$ -- 48
+duplicate$ -- 338
+empty$ -- 486
+format.name$ -- 94
+if$ -- 1277
+int.to.chr$ -- 4
int.to.str$ -- 0
-missing$ -- 24
-newline$ -- 141
-num.names$ -- 69
-pop$ -- 139
+missing$ -- 25
+newline$ -- 147
+num.names$ -- 72
+pop$ -- 145
preamble$ -- 1
-purify$ -- 138
+purify$ -- 144
quote$ -- 0
-skip$ -- 249
+skip$ -- 261
stack$ -- 0
-substring$ -- 161
+substring$ -- 168
swap$ -- 1
-text.length$ -- 23
-text.prefix$ -- 21
+text.length$ -- 24
+text.prefix$ -- 22
top$ -- 0
-type$ -- 180
-warning$ -- 23
-while$ -- 46
+type$ -- 188
+warning$ -- 24
+while$ -- 48
width$ -- 29
-write$ -- 301
+write$ -- 314
(There was 1 error message)
diff --git a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.log b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.log
index 9f59c1f..c00a7a4 100644
--- a/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.log
+++ b/doc/bachelorarbeit_EstherKleinhenz/.texpadtmp/bachelorabeit_EstherKleinhenz.log
@@ -1,4 +1,4 @@
-This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex 2018.6.7) 13 NOV 2018 10:04
+This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex 2018.6.7) 13 NOV 2018 18:40
entering extended mode
\write18 enabled.
file:line:error style messages enabled.
@@ -1076,20 +1076,20 @@ Package babel Info: Redefining german shorthand "~
])
-File: AcknowledgmentsDedicationSentence/erklaerung.pdf Graphic file (type pdf)
-