<script type="text/javascript">
$(function() {
    jQuery("#id_tags").autocomplete(
    {% if app_label and model %}
        '{% url tagging_ext_autocomplete app_label=app_label model=model %}{% if counts %}?counts={{counts}}{% endif %}',
    {% else %}
        '{% url tagging_ext_autocomplete %}{% if counts %}?counts={{counts}}{% endif %}',
    {% endif %}
{
	    max: 10,
	    highlight: false,
	    multiple: true,
	    multipleSeparator: " ",
	    scroll: true,
	    scrollHeight: 300,
	    matchContains: true,
	    autoFill: true,
	    formatItem: function(data, i, n, value){
	        return data[0]+" "+data[2];
	    },
	    formatResult: function(data, value){
	        return value;
	    }
});
});
</script> 

