@frappe.whitelist()
def get_variant(template, args, variant=None):
 if isinstance(args, basestring):
  args = json.loads(args)
 if (not args):
  frappe.throw(_(u'Please specify at least one attribute in the Attributes table'))
 return find_variant(template, args, variant)

@ frappe . whitelist ( ) def get_variant ( template , args , variant = None ) : if isinstance ( args , basestring ) : args = json . loads ( args ) if ( not args ) : frappe . throw ( _ ( u'Please specify at least one attribute in the Attributes table' ) ) return find_variant ( template , args , variant )
validates attributes and their values .