logistics package

Subpackages

Submodules

logistics.admin module

logistics.apps module

class logistics.apps.LogisticsConfig(app_name, app_module)[source]

Bases: AppConfig

default_auto_field = 'django.db.models.BigAutoField'
name = 'logistics'

logistics.models module

class logistics.models.InventoryReceipt(id, receipt_id, receipt_date, received_quantity, received_condition, inspection_notes, inspection_report, order)[source]

Bases: Model

CONDITION_CHOICES = [('good', 'Good'), ('damaged', 'Damaged'), ('defective', 'Defective')]
exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_next_by_receipt_date(*, field=<django.db.models.fields.DateField: receipt_date>, is_next=True, **kwargs)
get_previous_by_receipt_date(*, field=<django.db.models.fields.DateField: receipt_date>, is_next=False, **kwargs)
get_received_condition_display(*, field=<django.db.models.fields.CharField: received_condition>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

inspection_notes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

inspection_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)
objects = <django.db.models.manager.Manager object>
order

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 a ForwardOneToOneDescriptor instance.

order_id
receipt_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

receipt_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

received_condition

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

received_quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class logistics.models.Invoice(id, invoice_number, invoice_date, account_number, total_amount, payment_due_date, payment_mode, payment_status, invoice_report, vendor_rated, order)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

PAYMENT_MODE_CHOICES = [('credit', 'Credit'), ('debit', 'Debit'), ('cash', 'Cash'), ('cheque', 'Cheque')]
PAYMENT_STATUS_CHOICES = [('paid', 'Paid'), ('pending', 'Pending')]
account_number

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_invoice_date(*, field=<django.db.models.fields.DateField: invoice_date>, is_next=True, **kwargs)
get_next_by_payment_due_date(*, field=<django.db.models.fields.DateField: payment_due_date>, is_next=True, **kwargs)
get_payment_mode_display(*, field=<django.db.models.fields.CharField: payment_mode>)
get_payment_status_display(*, field=<django.db.models.fields.CharField: payment_status>)
get_previous_by_invoice_date(*, field=<django.db.models.fields.DateField: invoice_date>, is_next=False, **kwargs)
get_previous_by_payment_due_date(*, field=<django.db.models.fields.DateField: payment_due_date>, 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.

invoice_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

invoice_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

invoice_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)
objects = <django.db.models.manager.Manager object>
order

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 a ForwardOneToOneDescriptor instance.

order_id
payment_due_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

payment_mode

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

payment_status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

total_amount

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

vendor_rated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

logistics.serializers module

class logistics.serializers.InventoryReceiptSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

exclude = ['order']
model

alias of InventoryReceipt

read_only_fields = ['inspection_report']
class logistics.serializers.InvoicePaymentStatusSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ['payment_status']
model

alias of Invoice

class logistics.serializers.InvoiceSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

exclude = ['order']
model

alias of Invoice

read_only_fields = ['payment_status', 'invoice_report', 'vendor_rated']
class logistics.serializers.InvoiceVendorRatingSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

class Meta[source]

Bases: object

fields = ['vendor_rating', 'vendor_rated']
model

alias of Invoice

read_only_fields = ['vendor_rated']

logistics.tasks module

logistics.tests module

class logistics.tests.InventoryReceiptTests(methodName='runTest')[source]

Bases: SetupClass, TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_inventory_receipt_create_view_invalid_data()[source]
test_inventory_receipt_create_view_invalid_http_method()[source]
test_inventory_receipt_create_view_invalid_token()[source]
test_inventory_receipt_create_view_missing_data()[source]
test_inventory_receipt_create_view_one_to_one_purchase_order()[source]
test_inventory_receipt_create_view_order_status_delivered()[source]
test_inventory_receipt_create_view_order_status_pending()[source]
test_inventory_receipt_create_view_order_status_shipped()[source]
test_inventory_receipt_create_view_other_procurement_officer()[source]
test_inventory_receipt_create_view_procurement_officer()[source]
test_inventory_receipt_create_view_unauthenticated()[source]
test_inventory_receipt_create_view_vendor()[source]
test_inventory_receipt_delete_view_invalid_http_method()[source]
test_inventory_receipt_delete_view_invalid_token()[source]
test_inventory_receipt_delete_view_other_procurement_officer()[source]
test_inventory_receipt_delete_view_procurement_officer_own_item()[source]
test_inventory_receipt_delete_view_unauthenticated()[source]
test_inventory_receipt_delete_view_vendor()[source]
test_inventory_receipt_list_view_invalid_http_method()[source]
test_inventory_receipt_list_view_invalid_token()[source]
test_inventory_receipt_list_view_other_procurement_officer()[source]
test_inventory_receipt_list_view_procurement_officer()[source]
test_inventory_receipt_list_view_unauthenticated()[source]
test_inventory_receipt_list_view_vendor()[source]
test_inventory_receipt_retrieve_view_invalid_http_method()[source]
test_inventory_receipt_retrieve_view_invalid_token()[source]
test_inventory_receipt_retrieve_view_other_procurement_officer()[source]
test_inventory_receipt_retrieve_view_procurement_officer_own_item()[source]
test_inventory_receipt_retrieve_view_unauthenticated()[source]
test_inventory_receipt_retrieve_view_vendor()[source]
test_inventory_receipt_update_view_invalid_data()[source]
test_inventory_receipt_update_view_invalid_http_method()[source]
test_inventory_receipt_update_view_invalid_token()[source]
test_inventory_receipt_update_view_missing_data()[source]
test_inventory_receipt_update_view_other_procurement_officer()[source]
test_inventory_receipt_update_view_procurement_officer_own_item()[source]
test_inventory_receipt_update_view_unauthenticated()[source]
test_inventory_receipt_update_view_vendor()[source]
test_inventory_receipt_vendor_list_view_invalid_http_method()[source]
test_inventory_receipt_vendor_list_view_invalid_token()[source]
test_inventory_receipt_vendor_list_view_other_vendor()[source]
test_inventory_receipt_vendor_list_view_procurement_officer()[source]
test_inventory_receipt_vendor_list_view_unauthenticated()[source]
test_inventory_receipt_vendor_list_view_vendor()[source]
test_inventory_receipt_vendor_retrieve_view_invalid_http_method()[source]
test_inventory_receipt_vendor_retrieve_view_invalid_token()[source]
test_inventory_receipt_vendor_retrieve_view_other_vendor()[source]
test_inventory_receipt_vendor_retrieve_view_procurement_officer()[source]
test_inventory_receipt_vendor_retrieve_view_unauthenticated()[source]
test_inventory_receipt_vendor_retrieve_view_vendor_own_item()[source]
class logistics.tests.InvoiceTests(methodName='runTest')[source]

Bases: SetupClass, TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_invoice_create_view_invalid_data()[source]
test_invoice_create_view_invalid_http_method()[source]
test_invoice_create_view_invalid_token()[source]
test_invoice_create_view_missing_data()[source]
test_invoice_create_view_one_to_one_purchase_order()[source]
test_invoice_create_view_order_status_delivered()[source]
test_invoice_create_view_order_status_pending()[source]
test_invoice_create_view_order_status_shipped()[source]
test_invoice_create_view_other_vendor()[source]
test_invoice_create_view_procurement_officer()[source]
test_invoice_create_view_unauthenticated()[source]
test_invoice_create_view_vendor()[source]
test_invoice_delete_view_invalid_http_method()[source]
test_invoice_delete_view_invalid_token()[source]
test_invoice_delete_view_other_vendor()[source]
test_invoice_delete_view_procurement_officer()[source]
test_invoice_delete_view_unauthenticated()[source]
test_invoice_delete_view_vendor_own_item()[source]
test_invoice_list_view_invalid_http_method()[source]
test_invoice_list_view_invalid_token()[source]
test_invoice_list_view_other_vendor()[source]
test_invoice_list_view_procurement_officer()[source]
test_invoice_list_view_unauthenticated()[source]
test_invoice_list_view_vendor()[source]
test_invoice_payment_status_view_invalid_data()[source]
test_invoice_payment_status_view_invalid_http_method()[source]
test_invoice_payment_status_view_invalid_token()[source]
test_invoice_payment_status_view_missing_data()[source]
test_invoice_payment_status_view_other_procurement_officer()[source]
test_invoice_payment_status_view_procurement_officer()[source]
test_invoice_payment_status_view_status_paid()[source]
test_invoice_payment_status_view_unauthenticated()[source]
test_invoice_payment_status_view_vendor()[source]
test_invoice_procurement_officer_list_view_invalid_http_method()[source]
test_invoice_procurement_officer_list_view_invalid_token()[source]
test_invoice_procurement_officer_list_view_other_procurement_officer()[source]
test_invoice_procurement_officer_list_view_procurement_officer()[source]
test_invoice_procurement_officer_list_view_unauthenticated()[source]
test_invoice_procurement_officer_list_view_vendor()[source]
test_invoice_procurement_officer_retrieve_view_invalid_http_method()[source]
test_invoice_procurement_officer_retrieve_view_invalid_token()[source]
test_invoice_procurement_officer_retrieve_view_other_procurement_officer()[source]
test_invoice_procurement_officer_retrieve_view_procurement_officer_own_item()[source]
test_invoice_procurement_officer_retrieve_view_unauthenticated()[source]
test_invoice_procurement_officer_retrieve_view_vendor()[source]
test_invoice_retrieve_view_invalid_http_method()[source]
test_invoice_retrieve_view_invalid_token()[source]
test_invoice_retrieve_view_other_vendor()[source]
test_invoice_retrieve_view_procurement_officer()[source]
test_invoice_retrieve_view_unauthenticated()[source]
test_invoice_retrieve_view_vendor_own_item()[source]
test_invoice_update_view_invalid_data()[source]
test_invoice_update_view_invalid_http_method()[source]
test_invoice_update_view_invalid_token()[source]
test_invoice_update_view_missing_data()[source]
test_invoice_update_view_other_vendor()[source]
test_invoice_update_view_procurement_officer()[source]
test_invoice_update_view_unauthenticated()[source]
test_invoice_update_view_vendor_own_item()[source]
test_invoice_vendor_rating_view_invalid_data()[source]
test_invoice_vendor_rating_view_invalid_http_method()[source]
test_invoice_vendor_rating_view_invalid_token()[source]
test_invoice_vendor_rating_view_missing_data()[source]
test_invoice_vendor_rating_view_other_procurement_officer()[source]
test_invoice_vendor_rating_view_procurement_officer()[source]
test_invoice_vendor_rating_view_unauthenticated()[source]
test_invoice_vendor_rating_view_unpaid()[source]
test_invoice_vendor_rating_view_vendor()[source]
test_invoice_vendor_rating_view_vendor_rated()[source]
test_invoice_vendpr_rating_view_invalid_rating()[source]
class logistics.tests.SetupClass(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

logistics.urls module

logistics.views module

class logistics.views.BaseInventoryReceiptAPIView(**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 InventoryReceiptSerializer

class logistics.views.BaseInventoryReceiptVendorAPIView(**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 InventoryReceiptSerializer

class logistics.views.BaseInvoiceAPIView(**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 InvoiceSerializer

class logistics.views.BaseInvoiceProcurementOfficerAPIView(**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 InvoiceSerializer

class logistics.views.InventoryReceiptCreateView(**kwargs)[source]

Bases: BaseInventoryReceiptAPIView, CreateAPIView

perform_create(serializer)[source]
queryset = <QuerySet []>
class logistics.views.InventoryReceiptDeleteView(**kwargs)[source]

Bases: BaseInventoryReceiptAPIView, DestroyAPIView

perform_destroy(instance)[source]
queryset = <QuerySet []>
class logistics.views.InventoryReceiptListView(**kwargs)[source]

Bases: BaseInventoryReceiptAPIView, ListAPIView

class logistics.views.InventoryReceiptRetrieveView(**kwargs)[source]

Bases: BaseInventoryReceiptAPIView, RetrieveAPIView

class logistics.views.InventoryReceiptUpdateView(**kwargs)[source]

Bases: BaseInventoryReceiptAPIView, UpdateAPIView

patch(request, *args, **kwargs)[source]
perform_update(serializer)[source]
queryset = <QuerySet []>
class logistics.views.InventoryReceiptVendorListView(**kwargs)[source]

Bases: BaseInventoryReceiptVendorAPIView, ListAPIView

class logistics.views.InventoryReceiptVendorRetrieveView(**kwargs)[source]

Bases: BaseInventoryReceiptVendorAPIView, RetrieveAPIView

class logistics.views.InvoiceCreateView(**kwargs)[source]

Bases: BaseInvoiceAPIView, CreateAPIView

perform_create(serializer)[source]
queryset = <QuerySet []>
class logistics.views.InvoiceDeleteView(**kwargs)[source]

Bases: BaseInvoiceAPIView, DestroyAPIView

perform_destroy(instance)[source]
queryset = <QuerySet []>
class logistics.views.InvoiceListView(**kwargs)[source]

Bases: BaseInvoiceAPIView, ListAPIView

class logistics.views.InvoicePaymentStatusUpdateView(**kwargs)[source]

Bases: UpdateAPIView

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)

patch(request, *args, **kwargs)[source]
perform_update(serializer)[source]
permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
serializer_class

alias of InvoicePaymentStatusSerializer

class logistics.views.InvoiceProcurementOfficerListView(**kwargs)[source]

Bases: BaseInvoiceProcurementOfficerAPIView, ListAPIView

class logistics.views.InvoiceProcurementOfficerRetrieveView(**kwargs)[source]

Bases: BaseInvoiceProcurementOfficerAPIView, RetrieveAPIView

class logistics.views.InvoiceRetrieveView(**kwargs)[source]

Bases: BaseInvoiceAPIView, RetrieveAPIView

class logistics.views.InvoiceUpdateView(**kwargs)[source]

Bases: BaseInvoiceAPIView, UpdateAPIView

patch(request, *args, **kwargs)[source]
perform_update(serializer)[source]
queryset = <QuerySet []>
class logistics.views.InvoiceVendorRatingUpdateView(**kwargs)[source]

Bases: UpdateAPIView

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)

patch(request, *args, **kwargs)[source]
perform_update(serializer)[source]
permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'accounts.permissions.IsProcurementOfficer'>]
serializer_class

alias of InvoiceVendorRatingSerializer

logistics.views.getRoutes(request, *args, **kwargs)[source]

Module contents