def extend_reservation(self, timedelta):
self.validate_cart()<EOL>cart = self.cart<EOL>cart.refresh_from_db()<EOL>elapsed = (timezone.now() - cart.time_last_updated)<EOL>if cart.reservation_duration - elapsed > timedelta:<EOL><INDENT>return<EOL><DEDENT>cart.time_last_updated = timezone.now()<EOL>cart.reservation_duration = timedelta<EOL>cart.save()<EOL>
Extends the reservation on this cart by the given timedelta.
        This can only be done if the current state of the cart is valid (i.e
        all items and discounts in the cart are still available.)

        Arguments:
            timedelta (timedelta): The amount of time to extend the cart by.
                The resulting reservation_duration will be now() + timedelta,
                unless the requested extension is *LESS* than the current
                reservation deadline.