Tomas Gavenciak
10 years ago
7 changed files with 44 additions and 6 deletions
@ -0,0 +1,7 @@ |
|||
{% extends "admin/base.html" %} |
|||
{% load staticfiles %} |
|||
|
|||
{% block extrahead %} |
|||
<script src="{% static 'js/jquery-1.11.1.js' %}"></script> |
|||
{% include 'autocomplete_light/static.html' %} |
|||
{% endblock %} |
@ -0,0 +1,24 @@ |
|||
import autocomplete_light |
|||
from models import Skola |
|||
|
|||
# This will generate a PersonAutocomplete class |
|||
autocomplete_light.register(Skola, |
|||
# Just like in ModelAdmin.search_fields |
|||
search_fields=['nazev', 'mesto', 'ulice'], |
|||
attrs={ |
|||
# This will set the input placeholder attribute: |
|||
'placeholder': 'Skola', |
|||
# This will set the yourlabs.Autocomplete.minimumCharacters |
|||
# options, the naming conversion is handled by jQuery |
|||
'data-autocomplete-minimum-characters': 1, |
|||
}, |
|||
# This will set the data-widget-maximum-values attribute on the |
|||
# widget container element, and will be set to |
|||
# yourlabs.Widget.maximumValues (jQuery handles the naming |
|||
# conversion). |
|||
widget_attrs={ |
|||
'data-widget-maximum-values': 15, |
|||
# Enable modern-style widget ! |
|||
'class': 'modern-style', |
|||
}, |
|||
) |
Loading…
Reference in new issue