Simple inventory management for Django objects using the contenttypes framework.
INSTALLED_APPS = ( # ... 'inventory', )
Synchronize the database:
InvetoryItem object typically represents a physical item being inventoried
such as a product. The
InvetoryItem object must be created before performing
transactions that add or remove quantities of that item.
InvetoryItem objects can be created in the admin interface or through code.
When creating an
content_object associates any Django
model with the inventory item. For example, an project which has a
model to represent products sold on a website might create an
that product as follows:
from inventory.models import InventoryItem, StockStatus stockstatus = StockStatus.objects.get(name="In Stock") product = Product() item = InventoryItem(sku="0001", content_object=product, stock_status=stockstatus) item.save()
InventoryItem exists, inventory "transactions" can be performed on the
item to increment or decrement the quantity. Using transactions allows better
tracking of items in and out of inventory and cost of goods sold.
- The django-genericadmin project can be used to add better support for the generic relationships in Django's admin interface.