2๐
You could subclass the model in the external app in one of your own apps, that would probably be a reasonable solution, i.e.
from someapp.models import SomeModel
from taggit.managers import TaggableManager
class SomeModelTagged(SomeModel):
tags = TaggableManager()
Then in the views where you used SomeModel from the external app you would have to use your new model instead.
๐คtijs
2๐
You can easily register model from any of your external apps with taggit. Assume the name of the model is Item.
from taggit.managers import TaggableManager
from external_app.models import Item
Item.add_to_class('tags', TaggableManager())
And then you can use taggit in usual way.
i = Item.objects.get(pk=1)
i.tags.add("wassup")
i.tags.all()
๐คAkshar Raaj
- [Django]-How do I fix this error in Python Django involving request.user.is_authenticated() and bool object not callable?
- [Django]-Frustrated by Django User matching query does not exist message
- [Django]-How disable a field if other field is chosen using Django or JavaScript?
0๐
You could have pip install the editable version with (-e VCS+REPOS_URL[@REV]#egg=PACKAGE) and add the django-taggable integration yourself.
๐คRyanBrady
- [Django]-Why do we write [0] after get_or_create in model_name.object.get_or_create() in django
- [Django]-How do I get the client Remote Port number in a Django?
- [Django]-Django testing: RequestFactory() follow redirect
Source:stackexchange.com