Sunday, November 22, 2015

How to search by country using django-countries?

I have a Model containing a CountryField (using https://pypi.python.org/pypi/django-countries):

class Person(models.Model):      name = models.CharField(max_length=100)      country = CountryField(          countries_flag_url='//flags.example.com/{code}.png')

I want to be able to search in admin interface by country. But it doesn't work. What can I do?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3ba081c2-49ed-4e2c-b542-3bdb28a22f91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment