Using django-taggit-templatetags2 , I can display all the tags associated with the test vlog on the template page.
I have vlogs stored in db that are not yet released to the public (displayed only after a certain date), so I can store numerous vlog data in db and then automatically issue each individual vlog on a specific day (Tuesday every week).
This means that django-taggit-templatetags2 displays all the code {% for tag in vlog_tags %} will include tags for vlog entries that are not yet displayed to the user in vlog, but are stored in db.
How can I only display tags and counters for vlog entries, where vlog_date_published not greater than now ? . There may be the same tags that are used for published and not-published journal entries. Therefore, this should be considered when displaying the tag.
Here is my model code:
from taggit.managers import TaggableManager class VlogDetails(models.Model): .... vlog_date_published = models.DateField(null=False, blank=False, default=datetime.now, help_text='The date the vlog video will be made public.') vlog_tags = TaggableManager(blank=True, help_text='To make a new tag, add a comma after the new tag name.') ....
Here is the code for the display template for all tags:
{% load taggit_templatetags2_tags %} {% get_taglist as vlog_tags %} {% for tag in vlog_tags %} {% if tag.num_times > 0 %} <a class='u-tags-v1 g-color-grey g-bg-grey-opacity-0_1 g-bg-grey--hover g-color-white--hover g-rounded-50 g-py-4 g-px-15' href="{% url 'vlog_tag' tag %}" hreflang="en" rel="tooltip" title="{% blocktrans %}Display all vlog entries containing this tag.{% endblocktrans %}"><i class="fa fa-tag icon_padding"></i> {{tag}} x {{tag.num_times}}</a> {% endif %} {% endfor %}
EDIT
Here is a screenshot from the database related to the tag that is displayed to the user, even if vlog is not yet displayed to the user, but is saved in db, waiting for automatic publication based on vlog_date_published > now .
In this case, the Employment NDA tag should not be displayed to the user, since the vlog record using this tag is not yet displayed to the user, since vlog_date_published larger than today (at the time of this post).
vlogdetails table (id = 24): 
taggit_taggeditem table (id = 191 - FK 24 and 123): 
taggit_tag table (id = 123): 
OTHER IMAGE
Thus, in this case, the next Employment NDA tag should not be displayed, since it refers to vlog data that has not yet been published / displayed to the public, while all other tags should be displayed (like vlog details that all other tags belong to publication):
