InvManage.views.company_views

Module Contents

Functions

create_company_view(request)

Creates a company on POST request and returns a company creation form GET request.

update_company_view(request)

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

delete_company_view(request, pk)

Deletes the company with primary key pk on POST request.

display_companies_view(request)

Retrieves the list of companies on GET request.

InvManage.views.company_views.create_company_view(request)

Creates a company on POST request and returns a company creation form GET request.

GET /company

Gets the company creation form.

Example request:

GET /company/ 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 – Company creation form received successfully.

POST /company

Creates a company.

Example request:

POST /company/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • comp-nameFringillami

  • comp-ownerIvor Barnett

  • comp-gstin89AAC056465468

  • comp-phone332 220-7026

  • comp-addressAp #849-6241 Euismod Av., 677598, Carinthia, Belgium

  • comp-emailest.tempor@fringillami.org

  • comp-locationBelgium

  • ship-titleFingDocks

  • ship-nameHarding Gross

  • ship-phone936 651-4847

  • ship-address8798 At, St., 7639

  • ship-cityRome

  • ship-stateLazio

  • ship-countryItaly

  • ship-websitefringdocs.com

  • ship-post300326

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

Status Codes
InvManage.views.company_views.update_company_view(request)

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

GET /company/update

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

Example request:

GET /company/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 company.

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 – Company update form received successfully.

POST /company/update

Updates a company.

Example request:

POST /company/ HTTP/1.1
Host: localhost:8000
Content-Type: multipart/form-data;
Form Parameters
  • pk4

  • comp-nameFringillami

  • comp-ownerIvor Barnett

  • comp-gstin89AAC056465468

  • comp-phone332 220-7026

  • comp-addressAp #849-6241 Euismod Av., 677598, Carinthia, Belgium

  • comp-emailest.tempor@fringillami.org

  • comp-locationBelgium

  • ship-titleFingDocks

  • ship-nameHarding Gross

  • ship-phone936 651-4847

  • ship-address8798 At, St., 7639

  • ship-cityRome

  • ship-stateLazio

  • ship-countryItaly

  • ship-websitefringdocs.com

  • ship-post300326

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

Status Codes
InvManage.views.company_views.delete_company_view(request, pk)

Deletes the company with primary key pk on POST request.

POST /company/<str:object_id>/delete

Deletes the company represented by the primary key object_id.

Example request:

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

Response Headers
Status Codes
InvManage.views.company_views.display_companies_view(request)

Retrieves the list of companies on GET request.

GET /companies/

Gets the list of all companies.

Example request:

GET /companies/ 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 companies 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 companies received successfully.