We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code:
ModelA(models.Model): text_for_search=models.CharField() objects = ModelAManager( fields=('text_for_search'), search_field='search_index', auto_update_search_field=True ) ModelB(ModelA) pass
ModelB.objects is QuerySet, not SearchQuerySet... How i can fix it?
ps. I don't wont to make ModelA abstract.
The text was updated successfully, but these errors were encountered:
As workaround (for add searh() to query set):
class AddSearchQuerySet(models.QuerySet): def search(self, *args, **kwargs): return SearchQuerySet(model=ModelA, using=self._db).search(*args, **kwargs) ModelB(ModelA) objects = models.Manager.from_queryset(AddSearchQuerySet)() # this is for update parent search index, while saved child models.signals.post_save.connect(auto_update_search_field_handler, sender=ModelB)
update, seems it not very good workaround, because it changed self.model of qs.
Sorry, something went wrong.
No branches or pull requests
Code:
ModelB.objects is QuerySet, not SearchQuerySet... How i can fix it?
ps. I don't wont to make ModelA abstract.
The text was updated successfully, but these errors were encountered: