fix issue w/ tags binding

This commit is contained in:
Kuroshini 2019-12-09 17:40:05 +03:00
parent d12ad93fe1
commit be793eed73

View File

@ -32,3 +32,11 @@ class TagCategoryDocument(Document):
def get_queryset(self):
return super().get_queryset().with_base_related()
def get_instances_from_related(self, related_instance):
"""If related_models is set, define how to retrieve the Car instance(s) from the related model.
The related_models option should be used with caution because it can lead in the index
to the updating of a lot of items.
"""
if isinstance(related_instance, News):
return related_instance.tags