Django: Add and Subtract from inventory in models
问题 I'm trying to do something that I thought would be simple, but it has proven a bit challenging for me right now. I am trying to build a simple ATM system for Banknotes in Django 1.11 and Python 3.6. I basically need to keep track of banknotes that are in stock and how many of each kind. But I realized that using the logic that I'm accustomed with I only create new instances of the model instead of adding to the quantity fields. I know how to use a quantity field to add items of an order (but