forked from juliocc/django-taggit-autosuggest-select2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.txt
45 lines (36 loc) · 1.81 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
This is my fork of https://bitbucket.org/fabian/django-taggit-autosuggest
Instead of using jQuery autosuggest, this widget uses [Select2](http://ivaynberg.github.com/select2/).
## Credits
This project is directly based on those projects:
* Alex Gaynor
* https://github.com/alex/django-taggit
* Ludwik Trammer:
* http://code.google.com/p/django-tagging-autocomplete/
* Jeremy Epstein:
* https://github.com/Jaza/django-taggit-autocomplete
* Flavio Curella:
* https://github.com/fcurella/django-taggit-autocomplete
* Drew Wilson:
* http://code.drewwilson.com/entry/autosuggest-jquery-plugin
## Installation
* If django-taggit isn't installed yet, add 'taggit' to your INSTALLED_APPS in your project settings
* Add "taggit_autosuggest_select2" to your INSTALLED_APPS in your project settings
* Run "python manage.py collectstatic" in your django site dir.
* Add the following line to your project's urls.py file:
`(r'^taggit_autosuggest_select2/', include('taggit_autosuggest_select2.urls')),`
## Settings
* `TAGGIT_AUTOSUGGEST_SELECT2_LOAD_SELECT2` (Defaults to True)
Set to False if you don't want the widget to load select2 libraries.
(useful if it is already loaded).
* `TAGGIT_AUTOSUGGEST_SELECT2_STATIC_BASE_URL`
Instead of collecting and serving the static files directly, you can
also set this variable to your static base URL somewhere else.
* `TAGGIT_AUTOSUGGEST_SELECT2_MAX_SUGGESTIONS` (Defaults to 20):
The amount of suggestions is limited, you can raise or lower the limit
of default 20 using this setting.
## Usage
* To enable autosuggesting Tags, just let the tagged model use `TaggableManager`:
from django.db import models
from taggit_autosuggest_select2.managers import TaggableManager
class SomeModel(models.Model):
tags = TaggableManager()