Commits

Anonymous committed bdbd8d2

Automated commit message.

Comments (0)

Files changed (1)

+== Usage Example ==
+
+for a more detailed example, see the [[http://bitbucket.org/tyrion/django-autocomplete/src/tip/ac_example/|demo application]].
+
+urls.py
+{{{
+#!python
+from django.contrib.auth.models import User
+from autocomplete import autocomplete
+
+
+autocomplete.register('user', User.objects.all(), ('username', 'email'), 5)
+
+urlpatterns = patterns('',
+    url('^autocomplete/(\w+)/$', autocomplete, name='autocomplete'),
+    # other patterns
+)
+}}}
+
+forms.py
+{{{
+#!python
+from django import forms
+from django.contrib.auth.models import Message
+from autocomplete import AutoCompleteField
+
+class InsertMessage(forms.ModelForm):
+    class Meta:
+        model = Message
+
+    user = AutoCompleteField('user')
+}}}
+
+You can use AutoCompleteField/Widget even on the admin site.