def new_offer(request, id=-1): sale = Sale.objects.get(id=id) price = request.POST["price"] try: float(price) except ValueError: return HttpResponseRedirect("/browse/%s/" % sale.id) try: offer = Offer.objects.get(sale=sale, buyer=request.user) except: offer = Offer() offer.new(sale, request.user, request.POST["price"]) return HttpResponseRedirect("/browse/%s/" % sale.id)
def _buildOfferFromDictionary_and_issue(dict, user, issue): offer = Offer.newOffer(issue, user, Decimal(0), '', False, False, None) _setOfferAttributesFromDictionary(offer, dict) return offer
def _buildOfferFromDictionary_and_issue(dict, user, issue): offer = Offer.newOffer(issue, user, Decimal(0), '', '', False, False, None) _setOfferAttributesFromDictionary(offer, dict) return offer