class Item(EsIndexable, models.Model):
title = models.CharField( blank=True)
tag = models.ManyToManyField('Tag', blank=True)
class Elasticsearch(EsIndexable.Elasticsearch):
serializer_class = ItemEsSerializer
fields = ['title', 'tag']
@receiver(post_save, sender= Item)
def index_elastic(instance, **kwargs):
instance.es.do_index()
class Newmodel(Item):
class Meta:
proxy = True
class Elasticsearch(EsIndexable.Elasticsearch):
serializer_class = NewModelEsSerializer
fields = ['title', 'tag']
@receiver(post_save, sender= Newmodel)
def new_index_elastic(instance, **kwargs):
print('Index proxy')
instance.es.do_index()--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/967390f9-5c81-4f0d-8cb5-9c24a9f88466%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.