inventory package
Subpackages
Submodules
inventory.admin module
inventory.apps module
inventory.models module
- class inventory.models.HistoricalInventory(id, stock_quantity, demand, datetime, inventory)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- datetime
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- demand
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_next_by_datetime(*, field=<django.db.models.fields.DateTimeField: datetime>, is_next=True, **kwargs)
- get_previous_by_datetime(*, field=<django.db.models.fields.DateTimeField: datetime>, is_next=False, **kwargs)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inventory
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- inventory_id
- objects = <django.db.models.manager.Manager object>
- stock_quantity
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class inventory.models.Inventory(id, item_name, description, unit_price, stock_quantity, location, date_added, last_updated, image, procurement_officer)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- date_added
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_next_by_date_added(*, field=<django.db.models.fields.DateTimeField: date_added>, is_next=True, **kwargs)
- get_next_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=True, **kwargs)
- get_previous_by_date_added(*, field=<django.db.models.fields.DateTimeField: date_added>, is_next=False, **kwargs)
- get_previous_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=False, **kwargs)
- historicalinventory_set
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- image
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- item_name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- last_updated
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- location
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>
- optimizedinventory
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- procurement_officer
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- procurement_officer_id
- purchaserequisition
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- stock_quantity
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- unit_price
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class inventory.models.OptimizedInventory(id, demand, ordering_cost, holding_cost, lead_time, service_level, safety_stock, reorder_point, shelf_life, storage_limit, eoq, inventory)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- demand
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- eoq
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- holding_cost
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inventory
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
- inventory_id
- lead_time
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>
- ordering_cost
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reorder_point
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- safety_stock
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- service_level
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- shelf_life
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- storage_limit
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
inventory.serializers module
- class inventory.serializers.HistoricalInventorySerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
- class Meta[source]
Bases:
object
- exclude = ['inventory']
- model
alias of
HistoricalInventory
inventory.tasks module
inventory.tests module
- class inventory.tests.ARIMAForecastViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
- class inventory.tests.HistoricalInventoryViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
- class inventory.tests.InventorySignalsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
- class inventory.tests.InventoryViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
- class inventory.tests.OptimizedInventoryViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
inventory.urls module
inventory.views module
- class inventory.views.ARIMAForecastAPIView(**kwargs)[source]
Bases:
GenericAPIView
- get_queryset(inventory_id)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
alias of
ARIMAForecastSerializer
- class inventory.views.BaseInventoryAPIView(**kwargs)[source]
Bases:
GenericAPIView
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
alias of
InventorySerializer
- class inventory.views.BaseOptimizedInventoryAPIView(**kwargs)[source]
Bases:
GenericAPIView
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- lookup_field = 'inventory_id'
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
alias of
OptimizedInventorySerializer
- class inventory.views.HistoricalInventoryListView(**kwargs)[source]
Bases:
ListAPIView
- get_queryset()[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
alias of
HistoricalInventorySerializer
- class inventory.views.InventoryCreateView(**kwargs)[source]
Bases:
BaseInventoryAPIView
,CreateAPIView
- queryset = <QuerySet [<Inventory: item 1>]>
- class inventory.views.InventoryDeleteView(**kwargs)[source]
Bases:
BaseInventoryAPIView
,DestroyAPIView
- class inventory.views.InventoryListView(**kwargs)[source]
Bases:
BaseInventoryAPIView
,ListAPIView
- class inventory.views.InventoryRetrieveView(**kwargs)[source]
Bases:
BaseInventoryAPIView
,RetrieveAPIView
- class inventory.views.InventoryUpdateView(**kwargs)[source]
Bases:
BaseInventoryAPIView
,UpdateAPIView
- class inventory.views.OptimizedInventoryCreateAPIView(**kwargs)[source]
Bases:
CreateAPIView
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
alias of
OptimizedInventorySerializer
- class inventory.views.OptimizedInventoryDestroyAPIView(**kwargs)[source]
Bases:
BaseOptimizedInventoryAPIView
,DestroyAPIView
- class inventory.views.OptimizedInventoryRetrieveAPIView(**kwargs)[source]
Bases:
BaseOptimizedInventoryAPIView
,RetrieveAPIView
- class inventory.views.OptimizedInventoryUpdateAPIView(**kwargs)[source]
Bases:
UpdateAPIView
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
alias of
OptimizedInventorySerializer
- inventory.views.calculate_eoq_limited_storage(demand, ordering_cost, holding_cost, storage_capacity)[source]