django-admin-autocomplete

Admin mixin providing autocomplete features of ForeignKey fields.

3 years after

django-admin-autocomplete

Admin mixin providing autocomplete features of ForeignKey fields.

Usage example :

from django.contrib import admin
from django_admin_autocomplete import AutocompleteFKMixin

class ReviewAdmin(AutocompleteFKMixin, admin.ModelAdmin):
    related_search_fields  = {
        # plain lookup
        'manufacturer':('name',),
        # lookup aware of related field
        'line'        :{'search': ('name',), 'related': ('manufacturer',)},
        # lookup aware of two related fields
        'mattress'    :{'search': ('name',), 'related': ('manufacturer','line')},
        'retailer'    :('name',),
        'store'       :{
            # lookup for several fields
            'search': ('name', 'city', 'state__abbr', 'street_address1', 'zip_code'),
            'related': ('retailer',),
            }
        }

Related Repositories

awesome-django

awesome-django

A curated list of awesome Django apps, projects and resources. ...

django-fluent-blogs

django-fluent-blogs

A blog engine with flexible block contents (based on django-fluent-contents) ...

django-fancy-autocomplete

django-fancy-autocomplete

Deluxe autocomplete view helpers for Django projects. ...

django-yaaac

django-yaaac

Ajax Autocomplete Django application ...

django-su

django-su

Login as any user from the Django admin interface, then switch back when done ...


Top Contributors

artscoop saippuakauppias