Change q to self.q because q does not exist in that scope
Change q to self.q because q does not exist in that scope

yourlabs/django-autocomplete-light,yourlabs/django-autocomplete-light,yourlabs/django-autocomplete-light,yourlabs/django-autocomplete-light