-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding increase / decrease functions #103
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as increasing
|
@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