示例#1
0
 def has_uuid(uuid, product_data):
     has = is_correct_uuid(uuid)
     if not has:
         logger.info(
             NOT_SAVE_TEMPLATE.format(entity='Product',
                                      name=product_data['name'],
                                      field='uuid'))
     return has
示例#2
0
 def has_all_prices(_, product_data):
     price_types = price_file.extra_options['price_types']
     has = all(product_data.get(price_type) for price_type in price_types)
     if not has:
         logger.info(
             NOT_SAVE_TEMPLATE.format(entity='Product',
                                      name=product_data['name'],
                                      field='price'))
     return has
示例#3
0
 def has_uuid(uuid, product_data):
     has = is_correct_uuid(uuid)
     if not has:
         logger.info(NOT_SAVE_TEMPLATE.format(
             entity='Product',
             name=product_data['name'],
             field='uuid'
         ))
     return has
示例#4
0
    def has_vendor_code(_, product_data):
        has = bool(product_data['vendor_code'])

        if not has:
            logger.info(
                NOT_SAVE_TEMPLATE.format(entity='Product',
                                         name=product_data['name'],
                                         field='vendor_code'))

        return has
示例#5
0
    def has_vendor_code(_, product_data):
        has = bool(product_data['vendor_code'])

        if not has:
            logger.info(NOT_SAVE_TEMPLATE.format(
                entity='Product',
                name=product_data['name'],
                field='vendor_code'
            ))

        return has
示例#6
0
 def has_all_prices(_, product_data):
     price_types = price_file.extra_options['price_types']
     has = all(
         product_data.get(price_type)
         for price_type in price_types
     )
     if not has:
         logger.info(NOT_SAVE_TEMPLATE.format(
             entity='Product',
             name=product_data['name'],
             field='price'
         ))
     return has