Category Instance
API endpoint that allows CV Categories to be viewed or edited. In addition to the normal detail page, when provided with the param nested=True, the detail endpoint shows all Terms on the category. Then on the detail page, terms can be viewed, changed, deleted and added to the Category.
» click to learn about Filtering, Ordering and more...
Accepted filters:
- search: Search in the following fields: ^name. (^startswith, $regex, =exact)
- id: ID (exact)
- created: Created (exact)
- modified: Modified (exact)
- name: Name starts with (istartswith)
- description: Description contains (icontains)
- autocomplete: Autocomplete 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)
- label: Label contains (icontains)
- created_by: Created by Username (exact)
- modified_by: Modified by Username (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={"category":"name","operator":"contains","value":"Y00"},
{"category":"amount","operator":">","value":"10"},
{"category":"type__name","operator":"exact","value":"ANTIBODY"}
» more info about the query
param..
Preset mappings
- terms: {'name': 'term_count', 'aggregate': Count(F(terms), distinct=True)}
- deleted: <function filter_deleted at 0x7f8cbd712440>
- 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
API endpoint that allows CV Categories to be viewed or edited.
In addition to the normal detail page, when provided with the param *nested*=True,
the detail endpoint shows all Terms on the category.
Then on the detail page, terms can be viewed, changed, deleted and added to the Category.
None
The default modelviewset used in this project
Add JSONPatch like functionality to bulk update items.
### Bulk Delete
This view also allows for one to bulk delete items. The url needs to be appended by ``/bulk_delete/`` and the ids
need to be given by multiple query_params:
```
{current_url}/bulk_delete/?id=<id_1>,id=<id_2>
```
GET /api/v2/vocabularies/categories/cd9fb805-011f-463e-8112-75d3e3f4fcdb/?format=api&ordering=-deleted_by
https://labid-demo.embl.de/api/v2/vocabularies/categories/cd9fb805-011f-463e-8112-75d3e3f4fcdb/?format=api", "category": "property" }, "id": { "name": "id", "category": "property", "value": "cd9fb805-011f-463e-8112-75d3e3f4fcdb" }, "created_by": { "name": "created_by", "value": { "id": 2, "username": "admin", "full_name": "admin" }, "category": "property" }, "modified_by": { "name": "modified_by", "value": { "id": 2, "username": "admin", "full_name": "admin" }, "category": "property" }, "created": { "name": "created", "value": "2025-02-18T21:43:54.197398+01:00", "category": "property" }, "modified": { "name": "modified", "value": "2025-02-18T21:43:54.197498+01:00", "category": "property" }, "model_name": { "name": "model_name", "category": "property", "value": "category" }, "app_name": { "name": "app_name", "category": "property", "value": "vocabularies" }, "model_type": { "name": "model_type", "category": "property", "value": "DEFAULT" }, "name": { "name": "name", "value": { "id": "cd9fb805-011f-463e-8112-75d3e3f4fcdb", "name": "sample_library_orientation", "model_name": "category", "app_name": "vocabularies", "model_type": null }, "category": "property" }, "choice_label": { "name": "choice_label", "category": "property", "value": "sample_library_orientation" }, "description": { "name": "description", "category": "property", "value": "Sample Library Orientation" }, "label": { "name": "label", "category": "property", "value": "Sample_Library_Orientation" }, "status": { "name": "status", "value": { "value": "ACTIVE", "label": "Active" }, "category": "property" }, "source": { "name": "source", "category": "property", "value": "ENA Ontology" }, "version": { "name": "version", "category": "property", "value": "1.0" }, "terms": { "name": "terms", "category": "property", "value": [ { "id": "0f2a3457-4cd5-4cb9-b9f1-6c3346803069", "name": "5'-3'-5'-3'", "description": "", "dbxref_id": "5'-3'-5'-3'", "default": false, "short_name": "5'-3'-5'-3'", "image_url": "", "public": true }, { "id": "bb90ee9a-b9b6-4f62-9808-8db6102cf2ae", "name": "5'-3'-3'-5'", "description": "", "dbxref_id": "5'-3'-3'-5'", "default": false, "short_name": "5'-3'-3'-5'", "image_url": "", "public": true } ] }, "permissions": { "name": "permissions", "value": { "public": true, "actions": { "view": { "users": [ { "id": 2, "username": "admin", "email": "example-admin@embl.de", "is_active": true, "full_name": "admin" } ], "groups": [ { "id": 1, "name": "SYSTEM_GROUP" } ] }, "change": { "users": [ { "id": 2, "username": "admin", "email": "example-admin@embl.de", "is_active": true, "full_name": "admin" } ], "groups": [ { "id": 1, "name": "SYSTEM_GROUP" } ] }, "delete": { "users": [ { "id": 2, "username": "admin", "email": "example-admin@embl.de", "is_active": true, "full_name": "admin" } ], "groups": [] } }, "allowed": [ "view" ] }, "category": "property" }, "public": { "name": "public", "value": true, "category": "property" }, "owner": { "name": "owner", "value": { "id": 2, "username": "admin", "full_name": "admin" }, "category": "property" }, "owned_by": { "name": "owned_by", "value": { "id": 1, "name": "SYSTEM_GROUP" }, "category": "property" } } }{ "results": { "url": { "name": "url", "value": "