Merge branch 'cart' of git.2li.ch:ibz/web_AI-5 into cart
* 'cart' of git.2li.ch:ibz/web_AI-5: push form hack # Conflicts: # django/didgeridoo/webshop/forms.py # django/didgeridoo/webshop/templates/webshop/cart.html # django/didgeridoo/webshop/views.py
This commit is contained in:
commit
c5419bfc60
|
@ -68,10 +68,19 @@ class AddToCartForm(forms.Form):
|
|||
|
||||
|
||||
class CartForm(forms.Form):
|
||||
amount_field = forms.FloatField(
|
||||
amount_field = forms.IntegerField(
|
||||
label='pce',
|
||||
help_text='Enter a Value between 1 and 99.')
|
||||
print('cartform', amount_field)
|
||||
|
||||
def change_amount(self, article):
|
||||
print('CartForm.ChangeAmount')
|
||||
position = CartPosition.objects.get(article=article)
|
||||
self.amount_field = forms.IntegerField(
|
||||
label='pce',
|
||||
help_text='Enter a Value between 1 and 99.',
|
||||
initial=position.amount
|
||||
)
|
||||
return self.amount_field
|
||||
|
||||
|
||||
class CheckoutForm(forms.Form):
|
||||
|
|
|
@ -193,6 +193,7 @@ def registration(request):
|
|||
def cart(request):
|
||||
category_list = get_categories()
|
||||
currencies_form = CurrenciesForm
|
||||
cart_form = CartForm
|
||||
rate = ExchangeRate
|
||||
article_view = True
|
||||
currency_name = "CHF"
|
||||
|
@ -301,6 +302,7 @@ def cart(request):
|
|||
{'cart_position_list': cart_position_list,
|
||||
'totalprice_list': totalprice_list,
|
||||
'total': total,
|
||||
'cart_form': cart_form,
|
||||
'currencies_form': currencies_form,
|
||||
'amount_form': amount_form,
|
||||
'article_view': article_view,
|
||||
|
|
Loading…
Reference in New Issue