0

I recently updated my django-autocomplete-light from version 1.2.3 to 2.0.0a15.

I followed the tutorial what's need to do for the upgrade but still my autocomplete don't show up.

The autocomplete are working fine in the previous django-autocomplete-light version.

So far my win7 contains the following python lib.

C:\Windows\System32>pip freeze
Django==1.6.1  
django-autocomplete-light==2.0.0a15
django-generic-m2m==0.2.1
django-grappelli==2.5.1

In my autocomplete_light_registry.py a I have this config:

class CarrierAutocomplete(autocomplete_light.AutocompleteModelBase):
    print 'Using CarrierAutocomplete'   
    model       = Carrier
    search_fields       = ['c_initial', 'companyname']
    choices         = Carrier.objects.all()         
    attrs = {
        'data-autocomplete-minimum-characters': 0,
        #'placeholder': 'name or initial',
   }
   widget_attrs={
        'data-widget-maximum-values': 4,
        # Enable modern-style widget !
        'class': 'modern-style',
        }

   def choice_label(self, choice):      
       return u'<a href="%s"?_popup=1" target="_blank" onclick="return showAddAnotherPopup(this);">%s</a>' % (reverse('admin:ccad_carrier_change', args=(choice.id,)), choice,) 

In my Forms.py

class EquipmentForm(autocomplete_light.ModelForm): 
    ....
    class Meta:
        model   = Equipment
        autocomplete_names = {'carrier': 'CarrierAutocomplete'}

The output is like this.

enter image description here

What did I missed?

Thanks in advance for any enlightenment.

Community
  • 1
  • 1
Charlesliam
  • 1,293
  • 3
  • 20
  • 36

0 Answers0