@@ -17,5 +17,7 @@ | |||
{% endif %} | |||
<h1>{{ post.title }}</h1> | |||
<p>{{ post.text|linebreaksbr }}</p> | |||
<p>{{ post.tag }}</p> | |||
</div> | |||
{% endblock %} |
@@ -7,5 +7,10 @@ | |||
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a> | |||
</h1> | |||
<p>{{ post.text|linebreaks }}</p> | |||
{% for tag in post.tags.all %} | |||
<p>{{ tag.name }}</p> | |||
{% endfor %} | |||
</div> | |||
{% endfor %} {% endblock %} |
@@ -6,8 +6,6 @@ | |||
</button> | |||
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search"> | |||
</form> | |||
<div>{{Post.objects.filter(tags__name__in= ["hi"])}} | |||
</div> | |||
<div class="table-responsive"> | |||
<table class="table table-striped table-bordered table-hover"> | |||
</table> |
@@ -4,6 +4,7 @@ from . import views | |||
urlpatterns = [ | |||
url(r'^$', views.post_list, name='post_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'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'), | |||
url(r'^post/new/$', views.post_new, name='post_new'), | |||
url(r'^post/(?P<pk>\d+)/edit/$', views.post_edit, name='post_edit'), | |||
@@ -12,4 +13,3 @@ urlpatterns = [ | |||
url(r'^post/(?P<pk>\d+)/remove/$', views.post_remove, name='post_remove'), | |||
] | |||
""" url(r'^search/', views.blog_search_list_view, name='blog_search_list_view'), """ |
@@ -112,7 +112,6 @@ def post_remove(request, pk): | |||
def student_page(request): | |||
return render(request, 'student_page.html', {}) | |||
""" Search for querys | |||
def blog_search_list_view(post_list, self): | |||
result = super(post_list, self).get_queryset() | |||
query = self.request.GET.get('q') | |||
@@ -124,4 +123,4 @@ def blog_search_list_view(post_list, self): | |||
reduce(operator.and_, | |||
(Q(content__icontains=q) for q in query_list)) | |||
) | |||
return result """ | |||
return result |