import math


def packages(cart_item):
    """
    Returns the packages based on product's package unit and cart items
    amount.
    """
    packing_unit, packing_unit_unit = cart_item.product.get_packing_info()
    if packing_unit:
        return int(math.ceil(float(cart_item.amount) / packing_unit))
    return 0