Did I find the right examples for you? yes no

All Samples(33)  |  Call(33)  |  Derive(0)  |  Import(0)

src/l/f/lfs-HEAD/cart/utils.py   lfs(Download)
        # shipping method into account.
        delivery_time = shipping_utils.get_product_delivery_time(
            request, item.product.slug, for_cart=True)
        if (max_delivery_time is None) or \
           (delivery_time.as_hours() > max_delivery_time.as_hours()):

src/d/j/django-lfs-0.7.7/lfs/cart/models.py   django-lfs(Download)
        max_delivery_time = None
        for item in self.get_items():
            delivery_time = lfs.shipping.utils.get_product_delivery_time(request, item.product, for_cart=True)
            if (max_delivery_time is None) or (delivery_time.as_hours() > max_delivery_time.as_hours()):
                max_delivery_time = delivery_time

src/d/j/django-lfs-HEAD/lfs/cart/models.py   django-lfs(Download)
        max_delivery_time = None
        for item in self.get_items():
            delivery_time = lfs.shipping.utils.get_product_delivery_time(request, item.product, for_cart=True)
            if (max_delivery_time is None) or (delivery_time.as_hours() > max_delivery_time.as_hours()):
                max_delivery_time = delivery_time

src/d/j/django-lfs-0.7.7/lfs/core/templatetags/lfs_tags.py   django-lfs(Download)
        return {
            "deliverable": False,
            "delivery_time": shipping_utils.get_product_delivery_time(request, product)
        }
    else:
        return {
            "deliverable": True,
            "delivery_time": shipping_utils.get_product_delivery_time(request, product)

src/d/j/django-lfs-HEAD/lfs/core/templatetags/lfs_tags.py   django-lfs(Download)
        return {
            "deliverable": False,
            "delivery_time": shipping_utils.get_product_delivery_time(request, product)
        }
    else:
        return {
            "deliverable": True,
            "delivery_time": shipping_utils.get_product_delivery_time(request, product)

src/l/f/lfs-HEAD/core/templatetags/lfs_tags.py   lfs(Download)
        return {
            "deliverable" : False,
            "delivery_time" : shipping_utils.get_product_delivery_time(request, product.slug)
        }
    else:
        return {
            "deliverable" : True,
            "delivery_time" : shipping_utils.get_product_delivery_time(request, product.slug)

src/d/j/django-lfs-0.7.7/lfs/shipping/tests.py   django-lfs(Download)
        # (p1 has an weight of 6.0) we should get the delivery time from sm2,
        # which is dt2
        dt = utils.get_product_delivery_time(request, self.p1)
        self.assertEqual(dt.min, self.dt2.min)
        self.assertEqual(dt.max, self.dt2.max)
        self.assertEqual(dt.unit, self.dt2.unit)
 
        # For product 2 sm1 is valid (p2 has an weight of 11.0), hence we should
        # get dt1.
        dt = utils.get_product_delivery_time(request, self.p2)
        self.p1.save()
 
        dt = utils.get_product_delivery_time(request, self.p1)
        self.assertEqual(dt.min, self.dt3.min)
        self.assertEqual(dt.max, self.dt3.max)
        customer.save()
 
        dt = utils.get_product_delivery_time(request, self.p1, for_cart=True)
        self.assertEqual(dt.min, self.dt1.min)
        self.assertEqual(dt.max, self.dt1.max)
        self.assertEqual(dt.unit, self.dt1.unit)
 
        dt = utils.get_product_delivery_time(request, self.p2, for_cart=True)

src/d/j/django-lfs-HEAD/lfs/shipping/tests.py   django-lfs(Download)
        # (p1 has an weight of 6.0) we should get the delivery time from sm2,
        # which is dt2
        dt = utils.get_product_delivery_time(request, self.p1)
        self.assertEqual(dt.min, self.dt2.min)
        self.assertEqual(dt.max, self.dt2.max)
        self.assertEqual(dt.unit, self.dt2.unit)
 
        # For product 2 sm1 is valid (p2 has an weight of 11.0), hence we should
        # get dt1.
        dt = utils.get_product_delivery_time(request, self.p2)
        self.p1.save()
 
        dt = utils.get_product_delivery_time(request, self.p1)
        self.assertEqual(dt.min, self.dt3.min)
        self.assertEqual(dt.max, self.dt3.max)
        customer.save()
 
        dt = utils.get_product_delivery_time(request, self.p1, for_cart=True)
        self.assertEqual(dt.min, self.dt1.min)
        self.assertEqual(dt.max, self.dt1.max)
        self.assertEqual(dt.unit, self.dt1.unit)
 
        dt = utils.get_product_delivery_time(request, self.p2, for_cart=True)

src/l/f/lfs-HEAD/shipping/tests.py   lfs(Download)
        # (p1 has an weight of 6.0) we should get the delivery time from sm2, 
        # which is dt2
        dt = utils.get_product_delivery_time(request, self.p1.slug)
        self.assertEqual(dt.min, self.dt2.min)
        self.assertEqual(dt.max, self.dt2.max)
        self.assertEqual(dt.unit, self.dt2.unit)
 
        # For product 2 sm1 is valid (p2 has an weight of 11.0), hence we should 
        # get dt1.
        dt = utils.get_product_delivery_time(request, self.p2.slug)
        self.p1.save()
 
        dt = utils.get_product_delivery_time(request, self.p1.slug)
        self.assertEqual(dt.min, self.dt3.min)
        self.assertEqual(dt.max, self.dt3.max)
        customer.save()
 
        dt = utils.get_product_delivery_time(request, self.p1.slug, for_cart=True)
        self.assertEqual(dt.min, self.dt1.min)
        self.assertEqual(dt.max, self.dt1.max)
        self.assertEqual(dt.unit, self.dt1.unit)
 
        dt = utils.get_product_delivery_time(request, self.p2.slug, for_cart=True)