def __get__(self, instance, type=None): if instance != None: from rubber.resource import InstanceResource from rubber.instanceutils import get_pk return InstanceResource(instance, self.elasticsearch.makepath(get_pk(instance)), wrapper=self.elasticsearch.wrapsearchresponse, raise_on_error=self.elasticsearch.raise_on_error) return self.elasticsearch
def django_post_save(self, sender, instance, created, **kwargs): from rubber.instanceutils import get_pk self.put(get_pk(instance), instance)
def django_post_delete(self, sender, instance, **kwargs): from rubber.instanceutils import get_pk self.delete(get_pk(instance))