rs_server_catalog/timestamps_extension.md
Contains all functions for timestamps extension management.
set_timestamps_for_creation(item)
This function set the timestamps for an item creation. It will update the 'updated' and 'published' timestamps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be created. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/timestamps_extension.py
26 27 28 29 30 31 32 33 34 35 36 37 38 | |
set_timestamps_for_insertion(item)
This function set the timestamps for an item insertion. It will update the 'updated' and 'expires' timestamps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be updated. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/timestamps_extension.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
set_timestamps_for_update(item, original_published, original_expires)
This function set the timestamps for an item update. It will update the 'updated' timestamp along with the 'expires' and 'published' ones with the values given.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be updated. |
required |
original_published
|
str
|
Original 'published' timestamp to set. |
required |
original_expires
|
str
|
Original 'expires' timestamp to set. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/timestamps_extension.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
set_updated_timestamp_to_now(item)
Updates the 'updated' timestamp of the given item with the current time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be updated. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/timestamps_extension.py
80 81 82 83 84 85 86 87 88 89 90 91 | |