The Vertec Python module “vtcrest” for the REST API web service
The definitions of the Vertec REST API interface delivered as a Vertec rest api can be extension in the module “vtcrest”.
This includes the following classes and methods:
| Members | description |
|---|---|
member_name |
Member Name (String) |
class_name |
Class name (String) |
member_type |
Type of member (string), e.g. 'core attribute’, 'core association’, 'custom attribute’, 'custom association’ |
data_type |
Data type (string), e.g. 'object’, 'date’, 'datetime’ |
default_value |
Matching default value for the data type, e.g. ““, False, 0, None |
persistent |
Indicates whether it is a persistent member (Boolean). |
single_link |
Indicates whether the member is the 1 page of an association (Boolean). |
sql_columnname |
Name of the member in the database (String. From Vertec 6.8 always in English) |
custom_member_definition |
Can contain the definition of an custom field item or link type. |
All these values can be set and queried in the further code.
The feature set_data_type(data_type) sets the data type of the member and thus also the default value.
Defines the functionalities for the REST API web service.
| Methods | description |
|---|---|
onrequest |
Called at the beginning of each method call. Can be used to implement logging. |
currentuser_get |
Returns the current logged-in user. |
objects_get |
Here the search for the Vertec objects is implemented, which are queried in the request path. |
objects_put |
Here the changes of Vertec objects are implemented based on the specified values in the request body. |
objects_post |
Creates a Vertec object of the type specified in the request path with the values specified in the request body. |
objects_delete |
Deletes the object queried in the request path. |
A (sample) implementation is included with the Vertec rest api web service.
The Vertec Python module “vtcrest” is also available as a Stub File.