Messages Table
messages/messages.py¶
MessagesDB ¶
MessagesDB(dburi='localhost/tm_admin')
Bases: DBSupport
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dburi |
str
|
The URI string for the database connection |
'localhost/tm_admin'
|
Returns:
Type | Description |
---|---|
MessagesDB
|
An instance of this class |
Source code in tm_admin/messages/messages.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
getByFilter ¶
getByFilter(
user_id,
locale,
page,
page_size=10,
sort_by=None,
sort_direction=None,
message_type=None,
from_username=None,
project=None,
task_id=None,
status=None,
)
Filter Args: msg (MessagesTable): The filter criteria
Returns:
Type | Description |
---|---|
list
|
the messages that match the filter |
Source code in tm_admin/messages/messages.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
main ¶
main()
This main function lets this class be run standalone by a bash script.
Source code in tm_admin/messages/messages.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
options: show_source: false heading_level: 3
messages/messages_class.py¶
options: show_source: false heading_level: 3
messages/api.py¶
MessagesAPI ¶
MessagesAPI()
Bases: PGSupport
Returns:
Type | Description |
---|---|
MessagesAPI
|
An instance of this class |
Source code in tm_admin/messages/api.py
61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
initialize
async
¶
initialize(inuri)
Connect to all tables for API endpoints that require accessing multiple tables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inuri |
str
|
The URI for the TM Admin output database |
required |
Source code in tm_admin/messages/api.py
75 76 77 78 79 80 81 82 83 84 85 86 |
|
getByID
async
¶
getByID(message_id)
Get all the information for an message using it's ID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message_id |
int
|
The message to get the data for |
required |
Returns:
Type | Description |
---|---|
dict
|
the message information |
Source code in tm_admin/messages/api.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
getByName
async
¶
getByName(name)
Get all the information for a message using the name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The message to get the data for |
required |
Returns:
Type | Description |
---|---|
dict
|
the message information |
Source code in tm_admin/messages/api.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
main
async
¶
main()
This main function lets this class be run standalone by a bash script.
Source code in tm_admin/messages/api.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
options: show_source: false heading_level: 3