Questions tagged [django-tagging]

A generic tagging application for Django projects, which allows association of a number of tags with any Django model instance and tries to simplify retrieval of tags. Use this tag for questions related to the django application or tagging issues in Django.

A generic tagging application for Django projects, which allows association of a number of tags with any Django model instance and tries to simplify retrieval of tags. Use this tag for questions related to the Django application or tagging issues in Django.

87 questions
3
votes
4 answers

What are some useful non-built-in Django tags?

I'm relatively new to Django and I'm trying to build up my toolbox for future projects. In my last project, when a built-in template tag didn't do quite what I needed, I would make a mangled mess of the template to shoe-horn in the feature. I…
Eric Palakovich Carr
  • 22,701
  • 8
  • 49
  • 54
2
votes
1 answer

How do I make tags required with django-tagging?

I am using django-tagging to manage tags on my entities. How do I ensure that the user has entered at least one tag when filling out a form, other than using javascript validation on the front end?
Jamie Forrest
  • 10,895
  • 6
  • 51
  • 68
2
votes
1 answer

Multiple Tag Fields on One Model in Django, or ManyToMany Fields?

I have a Book model that needs two separate Tag fields: genre and tags. I'm considering whether it would be better to write my own Genre and BookTag models for this, and linking it with ManyToManyFields or using DjangoTagging to achieve the same.…
Herman Schaaf
  • 46,821
  • 21
  • 100
  • 139
2
votes
1 answer

Unknown specifier in URL when using Django-Tagging

Hi I am getting the following error; error at / unknown specifier: ?P[ This is what my URLS file looks like; urlpatterns = patterns('mainpage.views', (r'^$', 'index'), (r'^post/(?P\d+)/$', 'post'), (r'^projects/$',…
jayduff2
  • 51
  • 1
  • 3
2
votes
1 answer

How to know if a new tag is created in django-tagging?

How can I know if a new tag is created for a model? Looks like the django-tagging API does not provide such method. I'm new to both Django and django-tagging app and would like to hear your advice. Update: what I'm trying to acomplish is to add more…
grigy
  • 6,696
  • 12
  • 49
  • 76
2
votes
1 answer

Organizing django-tagging tags or assigning properties to tags?

I'd like to categorize my tags. Here's an example of the tags I have now: css, internet-explorer, firefox, floats Each of those are separate tags ( 4 in total obviously ). I would like to mark the internet-explorer and firefox tags as browsers. Does…
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
2
votes
2 answers

Added tagging to existing model, now how does its admin work?

I wanted to add a StackOverflow-style tag input to a blog model of mine. This is a model that has a lot of data already in it. class BlogPost(models.Model): # my blog fields try: tagging.register(BlogPost) except tagging.AlreadyRegistered: …
Oli
  • 235,628
  • 64
  • 220
  • 299
2
votes
1 answer

Django - Global navigation in base.html using model

I have a number of templates that extend base.html. I want the base.html template to house my global navigation and have the text and links in the global navigation be based on a model Division (i.e. the CharField in the model will be used as the…
2
votes
1 answer

AttributeError: 'TaggableManager' object has no attribute 'primary_key'

When I try to make the new migration, using the –auto feature. python manage.py schemamigration blogger --auto it shows: You cannot use --auto on an app with no migrations. Try --initial. So I run the first migration again in my terminal python…
htoniv
  • 1,658
  • 21
  • 40
2
votes
1 answer

Retrieving tags for a specific queryset with django-tagging

I'm using django-tagging, and am trying to retrieve a list of tags for a specific queryset. Here's what I've got: tag = Tag.objects.get(name='tag_name') queryset = TaggedItem.objects.get_by_model(Article, tag) tags =…
Nick Sergeant
  • 35,843
  • 12
  • 36
  • 44
1
vote
0 answers

Can two OneToOneFields of a model be set to point to unique instances of the same related model?

I tried to create a model "Tag Container" that stores tags. Then i tried to connect such a container with OneToOneFields to the model where i need it: from tagging.fields import TagFields class TagContainer(models.Model): tags=TagFields class…
marue
  • 5,588
  • 7
  • 37
  • 65
1
vote
1 answer

create custom views for django-tagging

I'm currently working on django tagging. I want to retrieve all the entries from my given model which are associated with a particular tag. But i don't want to use the generic views. So how should i design my views to get this done and how can i…
G Gill
  • 1,087
  • 1
  • 12
  • 24
1
vote
1 answer

Django HTML template tag for date

I get date data from an API on the internet, but it comes as a string. How do I convert this to the following format using django HTML template tag? Current date data format: 2022-02-13 00:00:00 UTC My wish format: 13 February 2022 00:00 My wish…
1
vote
1 answer

How to Pass Id Here (error put() missing 1 required positional argument: 'request') In form template Django

urls.py from django.urls import path from . import views app_name = "poll" urlpatterns = [ path('', views.index, name="index"), # listing the polls path('/edit/', views.put, name='poll_edit'), ] views.py def put(self, request,…
1
vote
1 answer

Django tag on template

My code: {% if request.user.is_staff %} {% extends "base.html" %} {% load crispy_forms_tags %} {% block content %}
{% csrf_token %}