I built one myself and it was quite easy, yust to give you an impression of the LoC used:
[EMAIL PROTECTED]:/usr/local/web/diamond $ wc -l shop/* shop/templates/shop/* 0 shop/__init__.py 105 shop/models.py 14 shop/urls.py 153 shop/views.py 56 shop/templates/shop/cart.html 36 shop/templates/shop/category.html 100 shop/templates/shop/checkout.html 13 shop/templates/shop/emptycart.html 21 shop/templates/shop/nocookie.html 32 shop/templates/shop/product.html 67 shop/templates/shop/shop_homepage.html 43 shop/templates/shop/thanks.html It was relatively simple since the order processing is done in an other (RUby on Rails) application and all the product data was already in place from other sources. So I basically had to provide the cart and nothing else. Some of the more interesting view functions are: def testcookie(request): request.session.set_test_cookie() return HttpResponseRedirect("../") def addtocart(request, artnr): if not request.session.test_cookie_worked(): return render_to_response('shop/nocookies.html', \ {}, context_instance=template.RequestContext(request)) else: request.session.delete_test_cookie() cart = request.session.get('cart', None) or Cart() cart.add_item(artnr) request.session['cart'] = cart return HttpResponseRedirect("/shop/cart") def cart(request): cart = request.session.get('cart', None) if not cart: return render_to_response('shop/emptycart.html', {}, context_instance=template.RequestContext(request)) else: return render_to_response('shop/cart.html', {'cart': cart}, context_instance=template.RequestContext(request)) def updatecart(request): cart = request.session.get('cart', None) if not cart: return render_to_response('shop/emptycart.html', {}, context_instance=template.RequestContext(request)) for k in request.POST: if k.startswith('menge_'): artnr = k.split('_')[1] menge = request.POST[k] menge = re.sub(r'[^0-9]', '', menge) if menge == '': menge = 0 try: menge = int(menge) except: menge = 1 cart.update_item(artnr, menge) request.session['cart'] = cart return HttpResponseRedirect("../") def checkout(request): cart = request.session.get('cart', None) manipulator = RecipientAddress.AddManipulator() if not cart: return render_to_response('shop/emptycart.html', {}, context_instance=template.RequestContext(request)) if request.POST: # If data was POSTed, try to create a new RecipientAddress. new_data = request.POST.copy() # Check for errors. errors = manipulator.get_validation_errors(new_data) if not errors: # No errors. This means we can save the data! manipulator.do_html2python(new_data) new_address = manipulator.save(new_data) request.session['oldcart'] = cart del(request.session['cart']) # remove cart from session request.COOKIES['hudora_kundennummer'] = / "WC%6d" % (new_address.id) consignment = Consignment(created_via='webshop',\ recipient=new_address) created_by_ip = request.META.get('REMOTE_ADDR', '') created_by_ua = request.META.get('HTTP_USER_AGENT', '') consignment.save() for cartitem in cart.items(): item = ConsignmentItem(consignment=consignment, quantity=cartitem['menge'], artnr=cartitem['artnr'], unit_price=cartitem['einzelpreis']) item.save() # add shipping and handling ConsignmentItem.objects.create(\ consignment=consignment, \ quantity=1, artnr='P0400', unit_price=4.00) def thanks(request): return render_to_response('shop/thanks.html', {'cart': request.session.get('oldcart', None), 'order': request.session.get('lastorder', None),}, context_instance=template.RequestContext(request)) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---