(self, prod_code)
return the product doc referenced by prod_code
return the product doc referenced by prod_code
return the product doc referenced by prod_code
def product_from_code(self, prod_code):
        """return the product doc referenced by prod_code"""
        prod_code = prod_code.lower()
        try:
            return SQLProduct.objects.get(domain=self.domain.name, code__iexact=prod_code)
        except SQLProduct.DoesNotExist:
            raise SMSError('invalid product code "%s"' % prod_code)
def product_from_code ( self , prod_code ) : prod_code = prod_code . lower ( ) try : return SQLProduct . objects . get ( domain = self . domain . name , code__iexact = prod_code ) except SQLProduct . DoesNotExist : raise SMSError ( 'invalid product code "%s"' % prod_code )