InvManage.views.vendor_views

Module Contents

Functions

create_vendor_view(request)

Creates a vendor on POST request, and returns a vendor creation form on GET request.

update_vendor_view(request)

Updates a vendor on POST request and returns the vendor update form for GET request.

delete_vendor_view(request, pk)

Deletes the vendor with primary key pk on POST request.

display_vendors_view(request)

Retrieves the list of vendors on GET request.

get_vendor(request)

Returns the JSON serialized data of the requested vendor on GET request.

InvManage.views.vendor_views.create_vendor_view(request)

Creates a vendor on POST request, and returns a vendor creation form on GET request.

GET /vendor

Gets the vendor creation form.

Example request:

GET /vendor/ HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Request Headers
  • Accept – text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Status Codes
  • 200 OK – Vendor creation form received successfully.

POST /vendor

Creates a vendor.

Example request:

POST /vendor/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • vend-nameLug Vendor

  • vend-identifierTBPN-02692

  • vend-gstin89AAC254254F2

  • ship-titleAKATSUKI

  • ship-nameKuame Burns

  • ship-phone679 166-3127

  • ship-addressNonummy Avenue

  • ship-cityChung Cheong

  • ship-stateGuanacaste

  • ship-countrytellusidnunc.net

  • ship-websiteGermany.protitor@tellusid.net

  • ship-post8949

  • pdform-currencyDEM

  • pdform-minorder2000

  • pdform-contactpersonHarding Gross

  • pdform-refcodeCUST000124

  • pdform-transportmodeExpress

  • com-languageGerman

  • com-phone936 651-4817

  • com-emailnon.sollicitudin@uttincidunt.org

  • com-fax323 555 1234

  • bank-nameFIRST FLORIDA INTEGRITY BANK

  • bank-branchBavaria

  • bank-regionBayem

  • bank-route67016325

  • bank-number42543251393

  • bank-acctypeCurrent

  • bank-ibanDE6233542

  • bank-codeBA54354354

  • bank-branchcodeBA35435823

Response Headers
  • Content-Type – multipart/form-data; boundary=—-WebKitFormBoundaryLTR88aZAnBUSE7mv

Status Codes
InvManage.views.vendor_views.update_vendor_view(request)

Updates a vendor on POST request and returns the vendor update form for GET request.

GET /vendor/update

Gets the vendor update form whose primary key matches the query parameter pk.

Example request:

GET /vendor/update HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Query Parameters
  • pk – The primary key of the vendor.

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Request Headers
  • Accept – text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Status Codes
  • 200 OK – Vendor update form received successfully.

POST /vendor/update

Updates the vendor.

Example request:

POST /vendor/update HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • vend-nameLug Vendor

  • vend-identifierTBPN-02692

  • vend-gstin89AAC254254F2

  • ship-titleAKATSUKI

  • ship-nameKuame Burns

  • ship-phone679 166-3127

  • ship-addressNonummy Avenue

  • ship-cityChung Cheong

  • ship-stateGuanacaste

  • ship-countrytellusidnunc.net

  • ship-websiteGermany.protitor@tellusid.net

  • ship-post8949

  • pdform-currencyDEM

  • pdform-minorder1000

  • pdform-contactpersonHarding Gross

  • pdform-refcodeCUST000124

  • pdform-transportmodeExpress

  • com-languageGerman

  • com-phone936 651-4817

  • com-emailnon.sollicitudin@uttincidunt.org

  • com-fax323 555 1234

  • bank-nameFIRST FLORIDA INTEGRITY BANK

  • bank-branchBavaria

  • bank-regionBayem

  • bank-route67016325

  • bank-number42543251393

  • bank-acctypeCurrent

  • bank-ibanDE6233542

  • bank-codeBA54354354

  • bank-branchcodeBA35435823

Response Headers
  • Content-Type – multipart/form-data; boundary=—-WebKitFormBoundaryLTR88aZAnBUSE7mv

Status Codes
InvManage.views.vendor_views.delete_vendor_view(request, pk)

Deletes the vendor with primary key pk on POST request.

POST /vendor/<str:object_id>/delete

Deletes the vendor represented by the primary key object_id.

Example request:

POST /vendor/5/delete HTTP/1.1
Host: localhost:8000
Content-Type: application/x-www-form-urlencoded
Parameters
  • object_id – Vendor primary key.

Response Headers
Status Codes
InvManage.views.vendor_views.display_vendors_view(request)

Retrieves the list of vendors on GET request.

GET /vendors/

Gets the list of all vendors.

Example request:

GET /vendors/ HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Form Parameters
  • page – The page number of the vendors list.

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/html; charset=utf-8
Request Headers
  • Accept – text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Status Codes
  • 200 OK – List of vendors received successfully.

InvManage.views.vendor_views.get_vendor(request)

Returns the JSON serialized data of the requested vendor on GET request.

GET /get_vendor/

Gets the JSON serialized data of the requested vendor.

Example request:

GET /get_vendor/ HTTP/1.1
Host: localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Parameters
  • vendor_id – Vendor primary key.

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json; charset=utf-8

[
    {
        "name": "Lug Vendor",
        "identifier": "TBPN-02692",
        "gstin": "89AAC4683897343",
        "address": {
            "name": "Kuame Burns",
            "address": "Nonummy Avenue",
            "city": "Chung Cheong",
            "phone": "679 166-3127",
            "state": "Guanacaste",
            "country": "tellusidnunc.net",
            "post": "8949"
        }
    }
]
Response Headers
Status Codes