purchase package
Subpackages
Submodules
purchase.admin module
purchase.apps module
purchase.models module
- class purchase.models.PurchaseOrder(id, order_number, date_ordered, status, bid)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- STATUS_CHOICES = [('pending', 'Pending'), ('shipped', 'Shipped'), ('delivered', 'Delivered')]
- bid
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.
- bid_id
- date_ordered
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_ordered(*, field=<django.db.models.fields.DateField: date_ordered>, is_next=True, **kwargs)
- get_previous_by_date_ordered(*, field=<django.db.models.fields.DateField: date_ordered>, is_next=False, **kwargs)
- get_status_display(*, field=<django.db.models.fields.CharField: status>)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inventoryreceipt
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.
- invoice
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.
- objects = <django.db.models.manager.Manager object>
- order_number
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class purchase.models.PurchaseRequisition(id, requisition_number, date_created, last_updated, quantity_requested, expected_delivery_date, urgency_level, comments, attachments, status, report, inventory)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- STATUS_CHOICES = [('pending', 'Pending'), ('approved', 'Approved'), ('rejected', 'Rejected')]
- URGENCY_LEVEL_CHOICES = [('low', 'Low'), ('medium', 'Medium'), ('high', 'High')]
- attachments
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- comments
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_created
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- expected_delivery_date
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_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
- get_next_by_expected_delivery_date(*, field=<django.db.models.fields.DateField: expected_delivery_date>, 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_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
- get_previous_by_expected_delivery_date(*, field=<django.db.models.fields.DateField: expected_delivery_date>, is_next=False, **kwargs)
- get_previous_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=False, **kwargs)
- get_status_display(*, field=<django.db.models.fields.CharField: status>)
- get_urgency_level_display(*, field=<django.db.models.fields.CharField: urgency_level>)
- 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
- last_updated
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>
- quantity_requested
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- report
The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
- requisition_number
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- supplierbid_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.
- urgency_level
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class purchase.models.SupplierBid(id, quantity_fulfilled, unit_price, date_submitted, days_delivery, attachments, comments, status, supplier, requisition)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- STATUS_CHOICES = [('submitted', 'Submitted'), ('accepted', 'Accepted'), ('rejected', 'Rejected')]
- attachments
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- comments
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_submitted
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- days_delivery
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_submitted(*, field=<django.db.models.fields.DateTimeField: date_submitted>, is_next=True, **kwargs)
- get_previous_by_date_submitted(*, field=<django.db.models.fields.DateTimeField: date_submitted>, is_next=False, **kwargs)
- get_status_display(*, field=<django.db.models.fields.CharField: status>)
- id
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>
- purchaseorder
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.
- quantity_fulfilled
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- requisition
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.
- requisition_id
- status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- supplier
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.
- supplier_id
- unit_price
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
purchase.serializers module
- class purchase.serializers.PurchaseOrderSerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
- class Meta[source]
Bases:
object
- fields = '__all__'
- model
alias of
PurchaseOrder
- class purchase.serializers.PurchaseOrderStatusSerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
- class Meta[source]
Bases:
object
- fields = ['status']
- model
alias of
PurchaseOrder
- class purchase.serializers.PurchaseRequisitionSerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
- class purchase.serializers.PurchaseRequisitionVendorSerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
- class Meta[source]
Bases:
object
- exclude = ['status', 'inventory']
- model
alias of
PurchaseRequisition
- class purchase.serializers.SupplierBidProcurementOfficerSerializer(*args, **kwargs)[source]
Bases:
ModelSerializer
purchase.tasks module
purchase.tests module
- class purchase.tests.PurchaseOrderViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
- class purchase.tests.PurchaseRequisitionViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
- class purchase.tests.SupplierBidViewsTests(methodName='runTest')[source]
Bases:
SetupClass
,TestCase
purchase.urls module
purchase.views module
- class purchase.views.BasePurchaseRequisitionAPIView(**kwargs)[source]
Bases:
GenericAPIView
- get_object()[source]
Returns the object the view is displaying.
You may want to override this if you need to provide non-standard queryset lookups. Eg if objects are referenced using multiple keyword arguments in the url conf.
- 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
PurchaseRequisitionSerializer
- class purchase.views.BaseSupplierAPIView(**kwargs)[source]
Bases:
GenericAPIView
- get_object()[source]
Returns the object the view is displaying.
You may want to override this if you need to provide non-standard queryset lookups. Eg if objects are referenced using multiple keyword arguments in the url conf.
- 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.IsVendor'>]
- serializer_class
alias of
SupplierBidSerializer
- class purchase.views.PurchaseOrderListView(**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
PurchaseOrderSerializer
- class purchase.views.PurchaseOrderVendorListView(**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.IsVendor'>]
- serializer_class
alias of
PurchaseOrderSerializer
- class purchase.views.PurchaseOrderVendorStatusView(**kwargs)[source]
Bases:
UpdateAPIView
- 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.IsVendor'>]
- serializer_class
alias of
PurchaseOrderStatusSerializer
- class purchase.views.PurchaseRequisitionCreateView(**kwargs)[source]
Bases:
BasePurchaseRequisitionAPIView
,CreateAPIView
- queryset = <QuerySet []>
- class purchase.views.PurchaseRequisitionDeleteView(**kwargs)[source]
Bases:
BasePurchaseRequisitionAPIView
,DestroyAPIView
- queryset = <QuerySet []>
- class purchase.views.PurchaseRequisitionListView(**kwargs)[source]
Bases:
BasePurchaseRequisitionAPIView
,ListAPIView
- class purchase.views.PurchaseRequisitionRetrieveView(**kwargs)[source]
Bases:
BasePurchaseRequisitionAPIView
,RetrieveAPIView
- class purchase.views.PurchaseRequisitionUpdateView(**kwargs)[source]
Bases:
BasePurchaseRequisitionAPIView
,UpdateAPIView
- queryset = <QuerySet []>
- class purchase.views.PurchaseRequisitionVendorListView(**kwargs)[source]
Bases:
ListAPIView
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsVendor'>]
- queryset = <QuerySet []>
- serializer_class
alias of
PurchaseRequisitionVendorSerializer
- class purchase.views.SupplierBidCreateView(**kwargs)[source]
Bases:
BaseSupplierAPIView
,CreateAPIView
- queryset = <QuerySet []>
- class purchase.views.SupplierBidDeleteView(**kwargs)[source]
Bases:
BaseSupplierAPIView
,DestroyAPIView
- queryset = <QuerySet []>
- class purchase.views.SupplierBidListView(**kwargs)[source]
Bases:
BaseSupplierAPIView
,ListAPIView
- class purchase.views.SupplierBidProcurementOfficerListView(**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
- class purchase.views.SupplierBidProcurementOfficerRankingView(**kwargs)[source]
Bases:
GenericAPIView
- permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
- serializer_class
- class purchase.views.SupplierBidProcurementOfficerRetrieveView(**kwargs)[source]
Bases:
RetrieveAPIView
- 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
- class purchase.views.SupplierBidProcurementOfficerStatusView(**kwargs)[source]
Bases:
UpdateAPIView
- 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
- class purchase.views.SupplierBidRetrieveView(**kwargs)[source]
Bases:
BaseSupplierAPIView
,RetrieveAPIView
- class purchase.views.SupplierBidUpdateView(**kwargs)[source]
Bases:
BaseSupplierAPIView
,UpdateAPIView
- queryset = <QuerySet []>