I have created a test vlog application using django/python and django-taggit.
The vlog and tags are working as they should.
However, I want to list all the existing tags in the django-admin interface for new and updated vlog entries - similar to displaying the tags as a filter on the django-admin list page.
This will make the selection of new or existing tags for each new or updating vlog entry that much easier.
Here is what I mean by adding the tags as help-text
on the tags input field:
My models.py code:
class VlogDetails(models.Model):
....
vlog_video_image_url = models.URLField(null=False, blank=False, max_length=250, unique=True, help_text='http://img.youtube.com/vi/You_Tube_URL/0.jpg')
....
tags = TaggableManager(help_text='List all the available tags here.')
Here is the django-admin input form interface:
Is it possible to display the existing tags in another manner on the new / edit django-admin page?
I have already listed the existing / existing tags on the django-admin list page as a filter as shown below. This filter display does not display on the new / update input forms.
django-admin filter code:
class VlogDetailsAdmin(BaseDetailsAdmin):
....
list_filter = [
'vlog_date_published',
'tags',
'vlog_timestamp_added',
'vlog_timestamp_updated'
]
I have tried several things but none work and I cannot find any related ideas in the docs. Any suggestion would be appreciated. Thanks.
I will answer my own question.
I don't think that adding the tags to the new vlog page is possible - that is not possible for my level of coding experience.
However, after more investigation, I stumbled to an obscure post about django-taggit-autosuggest.
Follow the docs to install and set up the django-taggit-autosuggest.
Instead of listing all the existing tags in the help. The autosuggest option displays all the existing tags with the related letters, as shown below:
And again:
I hope that this helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With