List ordereditems or get detailed information by providing the ID in the url

  • /api/stocks/ordereditems/

    • GET list all ordereditemss/
      {
        "results": [
          {
            order: {
              "id": <generated_uuid>,
              "name": "Order Name"
            },
            stock: {
              "id": <uuid>,
              "type": "CELLLINE",
              "model": "SPECIMEN",
              "name": "Stock Name"
            }
            stock_type: "SPECIMEN",
            quantity: 10,
            total_price: 20,
            (..)
          },
          {
            order: {
              "id": <generated_uuid>,
              "name": "Order Name"
            },
            stock: {
              "id": <uuid>,
              "type": "CELLLINE",
              "model": "SPECIMEN",
              "name": "Stock Name"
            }
            stock_type: "SPECIMEN",
            quantity: 10,
            total_price: 20,
            (..)
          }
        ]
      }
      
  • /api/stocks/ordereditems/:ordereditemid

    • GET retrieve one ordereditems
      {
        order: {
          "id": <generated_uuid>,
          "name": "Order Name"
        },
        stock: {
          "id": <uuid>,
          "type": "CELLLINE",
          "model": "SPECIMEN",
          "name": "Stock Name"
        }
        stock_type: "SPECIMEN",
        quantity: 10,
        total_price: 20,
        (..)
      }
      
» click to learn about Filtering, Ordering and more...

Accepted filters:

- id: ID (exact)
- created: Created (exact)
- modified: Modified (exact)
- name: Name starts with (istartswith)
- description: Description contains (icontains)
- query: Search filter on the name property (exact)
- owner: Owner Username (exact)
- owned_by: Filter on list of owned by group names [OR] (exact)
- public: Public (exact)
- deleted: Deleted (exact)
- deleted_by: Deleted by (exact)
- deleted_date: Deleted date (exact)
- created_by: Created by Username (exact)
- modified_by: Modified by Username (exact)
- stock: Stock id (exact)
- stock_id: Stock id (exact)
- catalogue_number: Catalogue # contains (icontains)
- vendor: Origin/Vendor contains (icontains)
- batch_number: Origin/Vendor contains (icontains)
- status: Status (exact)
- order: Filter by order id (exact)
- quantity: Quantity (exact)
- price: Price (exact)
- total_price: Total price (exact)
- ordered_for: Ordered for Username (exact)
- notify: Notify (exact)

Advanced Filtering

You can also filter using a json object to process all search parameters. Currently this filter supports the syntax as produced/used by the http://summitroute.github.io/react-structured-filter/ search UI.

Example

?query_expression={"category":"name","operator":"contains","value":"Y00"},
       {"category":"amount","operator":">","value":"10"},
       {"category":"type__name","operator":"exact","value":"ANTIBODY"}
» more info about the query_expression param..

Preset mappings

- ordered_for: ordered_for__username
- order: order__name
- external_id: order__external_id
- stock: ['specimen__name', 'consumable__name', 'equipment__name', 'storageequipment__name']
- stock_type: ['specimen__type__name', 'consumable__type__name', 'equipment__type__name', 'storageequipment__type__name']
- specimen: specimen__name
- consumable: consumable__name
- equipment: equipment__name
- storageequipment: storageequipment__name
- deleted: <function filter_deleted at 0x7f45063765f0>
- deleted_by: deleted_by__username
- owner: owner__username
- owned_by: owned_by__name
- created_by: created_by__username
- modified_by: modified_by__username

Operators

- ==
- =
- >=
- >
- <=
- <
- contains
- icontains
- exact
- iexact
- startswith
- istartswith
- endswith
- iendswith

Permission filtering

Based on the current logged in user you can filter for objects that have a particular permission set:

- can_change: True/False, show objects that you can change
- can_delete: True/False, show objects that you can delete

# not applicable - will raise NotAcceptable:
- can_view: as this is always True, you can only view items you are allowed to see

Ordering

You can order on practically any field even spanning relations.

# reverse order on owner username
?ordering=-owner

# order on related field
?ordering=category__version
List ordereditems or get detailed information by providing the ID in the url

* ``/api/stocks/ordereditems/``
  - ``GET`` list all ordereditemss/
    ```
    {
      "results": [
        {
          order: {
            "id": <generated_uuid>,
            "name": "Order Name"
          },
          stock: {
            "id": <uuid>,
            "type": "CELLLINE",
            "model": "SPECIMEN",
            "name": "Stock Name"
          }
          stock_type: "SPECIMEN",
          quantity: 10,
          total_price: 20,
          (..)
        },
        {
          order: {
            "id": <generated_uuid>,
            "name": "Order Name"
          },
          stock: {
            "id": <uuid>,
            "type": "CELLLINE",
            "model": "SPECIMEN",
            "name": "Stock Name"
          }
          stock_type: "SPECIMEN",
          quantity: 10,
          total_price: 20,
          (..)
        }
      ]
    }
    ```

* ``/api/stocks/ordereditems/:ordereditemid``
  - ``GET`` retrieve one ordereditems
    ```
    {
      order: {
        "id": <generated_uuid>,
        "name": "Order Name"
      },
      stock: {
        "id": <uuid>,
        "type": "CELLLINE",
        "model": "SPECIMEN",
        "name": "Stock Name"
      }
      stock_type: "SPECIMEN",
      quantity: 10,
      total_price: 20,
      (..)
    }
    ```

None

GET /api/v2/stocks/ordereditems/?format=api&ordering=-public
HTTP 200 OK
Allow: GET, PUT, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "previous": null,
    "next": null,
    "current": 1,
    "total": 0,
    "total_pages": 1,
    "results": []
}