Hi, It is supposed to run 'index_elastic' when you save 'Item' entity. And to run 'new_index_elastic' when you save 'Newmodel' entity. May be the reason why you do not see proper logs that in your code all operations with entity are done based on 'Item' class?
Hope that helps. Regards, Constantine C. On Fri, May 12, 2017 at 8:23 AM, Yarnball <[email protected]> wrote: > I'm using a proxy model, so that I can use Elastic search on the same > model using two different serialisers. > > However, the new_index_elastic function never runs (ie I never see the > print, and my NewModel never gets indexed). > > How would I do this? > > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 > <https://groups.google.com/d/msgid/django-users/967390f9-5c81-4f0d-8cb5-9c24a9f88466%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Sincerely yours, Constantine C -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAK52boVTDvX1kVcU0NBkQt%3DgGYAGS2oOx4YC62YPKQs%3Djz8_Xw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

