title: Using django-cities-light with django-crispy-forms and django-ajax-selects
body: <p>I need to have a form where user enters name, email and selects a city and country. I am using <a href="https://github.com/yourlabs/django-cities-light" rel="nofollow">django-cities-light</a> to populate the database with list of cities and countries.</p>
  
  <p>Then, I create a form using <a href="https://github.com/maraujop/django-crispy-forms" rel="nofollow">django-crispy-forms</a> using the database model as shown below.</p>
  
  <h2>Models.py</h2>
  
  <pre><code>from cities_light.models import City, Country
  
  class CustomModel(models.Model):
      name = models.CharField(max_length=500)
      email = models.EmailField(blank=True)
      city = models.ForeignKey(City)
      country = models.ForeignKey(Country)
  </code></pre>
  
  <h2>Forms.py</h2>
  
  <pre><code>Class EntryForm(forms.ModelForm):
      class Meta:
          model = CustomModel
  
      def __init__(self, *args, **kwargs):
          super(EntryForm, self).__init__(*args, **kwargs)
  
          self.helper = FormHelper(self)
          self.helper.layout.append(ButtonHolder(
              Submit('save', 'Save', css_class='btn-primary')
              )
          )
  </code></pre>
  
  <p>Using this in a view gives me a form with two text fields (for name, email) and two select fields (for city, country). Now, since the number of cities is pretty high, I wish to change these to text fields that use <a href="https://github.com/crucialfelix/django-ajax-selects" rel="nofollow">django-ajax-selects</a> to show names of cities or countries when user starts typing.</p>
  
  <p>A section of <a href="http://django-cities-light.readthedocs.org/en/stable-3.x.x/contrib.html#module-cities_light.contrib.ajax_selects_lookups" rel="nofollow">documentation</a> provides AJAX_LOOKUP_CHANNELS, but I can't quite understand how to change my form and then connect it with ajax-selects. Any help is highly appreciated.</p>