newsdev/django-ajax-selects

Name: django-ajax-selects

Owner: NYT Newsroom Developers

Description: jQuery UI-powered auto-complete fields for ForeignKey, ManyToMany and text fields

Forked from: crucialfelix/django-ajax-selects

Created: 2017-02-09 01:50:48.0

Updated: 2017-12-23 01:07:29.0

Pushed: 2016-12-19 12:26:58.0

Homepage:

Size: 998

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Edit ForeignKey, ManyToManyField and CharField in Django Admin using jQuery UI AutoComplete.

Build Status PyPI version


selecting

selected

Documentation

http://django-ajax-selects.readthedocs.org/en/latest/

Quick Usage

Define a lookup channel:

urapp/lookups.py
 ajax_select import register, LookupChannel
 .models import Tag

ister('tags')
s TagsLookup(LookupChannel):

model = Tag

def get_query(self, q, request):
    return self.model.objects.filter(name__icontains=q).order_by('name')[:50]

def format_item_display(self, item):
    return u"<span class='tag'>%s</span>" % item.name

Add field to a form:

urapp/forms.py
s DocumentForm(ModelForm):

class Meta:
    model = Document

tags = AutoCompleteSelectMultipleField('tags')
Fully customizable
Assets included by default
Compatibility
Contributors

Many thanks to all contributors and pull requesters !

https://github.com/crucialfelix/django-ajax-selects/graphs/contributors

License

Dual licensed under the MIT and GPL licenses:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.