It's an autocomplete widget for django-taggit TagField: http://github.com/alex/django-taggit
Installation
- You need to have django-taggit already installed
- Clone django-taggit-live
- Run setup.py to install taggit_live (Alternatively you can use the command: pip install django-taggit-live)
- Add "taggit_live" to installed apps in your project's settings.
-
Add the following line to your project's urls.py file:
(r'', include('taggit_live.urls')),
Usage
You have to use TaggableManager your models.py file. Example:
from django.db import models
from taggit.managers import TaggableManager
class SomeModel(models.Model):
tags = TaggableManager()
Then you have to change form field in ModelForm. Example:
from taggit_live.forms import LiveTagField
class SomeForm(forms.ModelForm):
tags = LiveTagField()
class Meta:
model = SomeModel
Finally, you have to include jquery library in your ModelAdmin:
from taggit_live.forms import LiveTagField
class SomeAdmin(admin.ModelAdmin):
class Media:
css = {'all': ('/path_to/jquery-ui-autocomplete.css',
)
}
js = (
'/path_to/jquery-lib.js',
'/path_to/jquery-ui-autocomplete.js',
)