update tag links

This commit is contained in:
2022-01-05 22:53:42 +00:00
parent 9c94e3a215
commit b1fa1f76e5
4 changed files with 24 additions and 6 deletions

View File

@@ -234,6 +234,23 @@ class Post(models.Model):
def tag_string(self):
return self.get_tags()
@property
def three_tag_names(self):
tag_lst = []
count = 0
for t in self.tags.names():
tag_lst.append(t)
count += 1
if count > 2:
break
return tag_lst
@property
def tag_names(self):
return [t for t in self.tags.names()]
@property
def imageurl(self):
"""

View File

@@ -135,6 +135,7 @@ def tags(request, tag=""):
"featured_post": featured_post,
"job_members": job_members,
"tags_list": None,
"tag": tag,
}
return render(request, "posts/tag.html", context)