2👍
✅
So this one was tricky to track down, but the problem was actually in my index_queryset function.
This:
return self.get_model().objects.filter(specialty__search_include=True)
should actually be this:
return self.get_model().objects.filter(specialty__search_include=True).distinct()
That function had duplicates in it and was causing my error, not the solr schema like I had thought. Specialty is a ManyToManyField.
0👍
I just faced the same issue.
According to this topic it is necessary to remove .pyc
files. Inside of a project simply do the next (for Linux):
find . -name "*.pyc" -type f -delete
- [Answered ]-Add raw sql where clause to django queryset
- [Answered ]-Django access m2m field attribute from a queryset
- [Answered ]-Django Rest Framework – IntegrityError: null value in column "user_id" violates not-null constraint
- [Answered ]-Django saving choices values
Source:stackexchange.com