def price(self, qty):
        # first check for special discounts
        prices = self.tiers.filter(expires__isnull=False, quantity__lte=qty).exclude(expires__lt=datetime.date.today())
        
        if not prices.count() > 0:
            prices = self.tiers.filter(expires__isnull=True, quantity__lte=qty)

        if prices.count() > 0:
            # Get the price with the quantity closest to the one specified without going over
            return Decimal(prices.order_by('-quantity')[0].calculate_price(qty))

        else:
            log.debug("No quantity tier found for %s: qty=%d", self.id, qty)
            raise TieredPriceException('No price available')
Get a price for this qty.
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/shipping/modules/tieredquantity/models.py/Carrier.price