Open LennyLip opened 8 years ago
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.
Code:
ModelB.objects is QuerySet, not SearchQuerySet... How i can fix it?
ps. I don't wont to make ModelA abstract.