(self, *args, **kwargs)
return result
Saving a couch version of Product will trigger
        one way syncing to the SQLProduct version of this
        product.
Saving a couch version of Product will trigger
        one way syncing to the SQLProduct version of this
        product.
Saving a couch version of Product will trigger one way syncing to the SQLProduct version of this product .
def save(self, *args, **kwargs):
        """
        Saving a couch version of Product will trigger
        one way syncing to the SQLProduct version of this
        product.
        """
        # mark modified time stamp for selective syncing
        self.last_modified = datetime.utcnow()

        # generate code if user didn't specify one
        if not self.code:
            from corehq.apps.commtrack.util import generate_code
            self.code = generate_code(
                self.name,
                SQLProduct.objects
                    .filter(domain=self.domain)
                    .values_list('code', flat=True)
                    .distinct()
            )

        result = super(Product, self).save(*args, **kwargs)

        self.clear_caches(self.domain)
        self.sync_to_sql()

        return result
def save ( self , * args , * * kwargs ) : # mark modified time stamp for selective syncing self . last_modified = datetime . utcnow ( ) # generate code if user didn't specify one if not self . code : from corehq . apps . commtrack . util import generate_code self . code = generate_code ( self . name , SQLProduct . objects . filter ( domain = self . domain ) . values_list ( 'code' , flat = True ) . distinct ( ) ) result = super ( Product , self ) . save ( * args , * * kwargs ) self . clear_caches ( self . domain ) self . sync_to_sql ( ) return result