I have a model (we'll call it 'item') that can be tagged by users. Tags are specific to each user. So, for example, an item can have multiple tags by multiple users. I need to display a list of all items to a user. Within that list I'd like to be able to only show the tags for each item that the currently logged in user owns. I'm hoping that there is a fairly easy way of achieving this, but I've been unable to find anything helpful in the docs. Thanks in advance.
class Item
tags = ManyToManyField('tags.Tag')
class Tag
user = ForeignKey('auth.User')
So I collect a queryset of items to display on a page, and list through them in the template. I'd like to be able to only show the tags owned by the currently logged in user for each item in the queryset.
{% for item in items %}
{% for tag in item.tags %}
DISPLAY TAGS OWNED BY LOGGED IN USER
{% endfor %}
{% endfor %}
This is what I'd like to achieve ^