applegrew/django-select2 — pull request #111 by jdotjdot (2014-06-09 20:04:29+00:00)
Title: added '.distinct()' to result query on ModelJsonMixin

When using `django-select2`, I noticed that when using my `AutoModelSelect2Field`, I was ending up with the same object showing up multiple times in the result list.

My field looked as follows:
```python
class CampusSelectField(AutoModelSelect2Field):
queryset = Campus.objects.all()
search_fields = ['domain_set__domain__iexact', 'aliases__name__icontains', 'IPEDS_unitid__exact']
to_field = 'name'
```

The reason for the duplicates is that sometimes the same item would be matched in multiple search fields, or even multiple times within `aliases__name__icontains`, matching multiple aliases.

I added the `.distinct()` command to the mixin to prevent this.