0👍
✅
For a Tag()
to get all TaggedItem()
objects where a specific Tag()
is a ForeignKey
on the TaggedItem()
objects, you would want to access it as:
tag = Tag.objects.get(pk=1) # for example
tag.taggeditem_set() # returns all related taggeditems
Here is the related Django Docs:
1👍
I encountered this problem before.
It was because I forgot including the ‘tagging’ app into the INSTALLED_APP tuple of ‘settings.py’ for my site besides installing the ‘tagging’ app on the machine.
Hope it helps
- [Answer]-Django/mysql intermidiate table not inserting data
- [Answer]-Django OAuth Toolkit protected_resource for class-based views
Source:stackexchange.com