Created
June 16, 2014 19:35
-
-
Save g33klord/fd37e488eb0ab95f2c14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
attr_id = items['item']['attr_id'] | |
attribute = Attribute.objects.get(productid=prods.id,id=attr_id) | |
total_order += attribute.unit_price * int(quantity) | |
items[item]['price'] = attribute.unit_price | |
except Attribute.DoesNotExist: | |
total_order += prods.price * int(quantity) | |
items[item]['price'] = prods.price | |
except TypeError: | |
attr_id = items['item']['attr_id'] | |
attribute = Attribute.objects.get(productid=prods.id,id=attr_id) | |
items['attribute'] = attribute.label+attribute.value+attribute+unit | |
total_order += prods.price * int(quantity) | |
items[item]['price'] = prods.price | |
finally : | |
total_order += prods.price * int(quantity) | |
items[item]['price'] = prods.price |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment