+ {{ post.title }} +
+{{ post.text|linebreaks }}
+ Tags: {% for tag in post.tags.all %} + {{ tag.name }} + {% if not forloop.last %}, {% endif %} {% endfor %}+ {{ post.author }} +
+diff --git a/application/models.py b/application/models.py index 13fb9e5..54500f5 100644 --- a/application/models.py +++ b/application/models.py @@ -8,7 +8,6 @@ class CustomUser(models.Model): user = models.OneToOneField(User, null=True, on_delete=models.CASCADE) tags = TaggableManager() - class Post(models.Model): author = models.ForeignKey('auth.User', on_delete=models.CASCADE) title = models.CharField(max_length=200) diff --git a/application/templates/blog_search_list_view.html b/application/templates/blog_search_list_view.html index 74cc6c8..701af93 100644 --- a/application/templates/blog_search_list_view.html +++ b/application/templates/blog_search_list_view.html @@ -1,32 +1,27 @@ {% extends "base.html" %} {% block content %} {% load taggit_templatetags2_tags %} -{% get_taglist as tags for 'application.post' %} -
{{ post.text|linebreaks }}
+ Tags: {% for tag in post.tags.all %} + {{ tag.name }} + {% if not forloop.last %}, {% endif %} {% endfor %}+ {{ post.author }} +
+