adding increase / decrease functions #103
adding increase / decrease functions #103RawanAbuleil wants to merge 1 commit intoredhat-beyond:mainfrom
Conversation
supplier_product/views.py
Outdated
|
|
||
|
|
||
| def increase_quantity(request, id): | ||
| SupplierProduct.objects.filter(supplier_product_id=id).update(quantity=F('quantity')+1) |
There was a problem hiding this comment.
Why would you use this since you have increase method in the supplierproduct
supplier_product/views.py
Outdated
| def decrease_quantity(request, id): | ||
| product = SupplierProduct.objects.get(supplier_product_id=id) | ||
| if product.quantity > 0: | ||
| SupplierProduct.objects.filter(supplier_product_id=id).update(quantity=F('quantity')-1) |
|
|
@thetaxas2468
do tell if any help is needed. |
a984014 to
97677e5
Compare
|
|
91 is merged, please rebase on top of main and possibly squash the commits, it'll make it much easier to review. I believe we would be able to merge it today as Karam provided a lot of good feedback. |
97677e5 to
8e01a65
Compare
Creating increase / decrease quantity views functions : ** this code depends on suppliers.html code which hasn't been merged yes once the code is merged i will change it ** two functions has been created : which increase and decrease the quantity of a product by it's supplier *** modifie the code so it increase / decrease the quantity by "n" not one *** no changes in the suppliers html file.
8e01a65 to
e2352f2
Compare
|
You have the same problem as lior had in his closed PR about linkedin,check it out(the problem is about your commit maybe you have done commit --amend at the start or you have squashed your commit with the merged commit) |
****This PR is based on PR no. 91 , once it's merged will update
two view functions created :
one test has been created for each function .
added two buttons to the supplier html file
closed create increase / decrease functions #104