Organizations Table
organizations.py¶
OrganizationsDB ¶
OrganizationsDB(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 |
---|---|
OrganizationsDB
|
An instance of this class |
Source code in tm_admin/organizations/organizations.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
mergeManagers
async
¶
mergeManagers(inpg)
A method to merge the contents of the TM organisation_managers into the orgsanizations table as an array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inpg |
PostgresClient
|
The input database |
required |
Source code in tm_admin/organizations/organizations.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
main
async
¶
main()
This main function lets this class be run standalone by a bash script.
Source code in tm_admin/organizations/organizations.py
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 114 115 116 |
|
options: show_source: false heading_level: 3
organizations_class.py¶
options: show_source: false heading_level: 3
organizations/api.py¶
OrganizationsAPI ¶
OrganizationsAPI()
Bases: PGSupport
Returns:
Type | Description |
---|---|
OrganizationsAPI
|
An instance of this class |
Source code in tm_admin/organizations/api.py
53 54 55 56 57 58 59 60 61 62 |
|
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/organizations/api.py
64 65 66 67 68 69 70 71 72 73 74 75 |
|
getByID
async
¶
getByID(org_id)
Get all the information for an organization using it's ID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
org_id |
int
|
The organization to get the data for |
required |
Returns:
Type | Description |
---|---|
dict
|
the organization information |
Source code in tm_admin/organizations/api.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
getByName
async
¶
getByName(name)
Get all the information for a organization using the name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The organization to get the data for |
required |
Returns:
Type | Description |
---|---|
dict
|
the organization information |
Source code in tm_admin/organizations/api.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
getStats
async
¶
getStats(org_id)
Args:
Returns:
Source code in tm_admin/organizations/api.py
111 112 113 114 115 116 117 118 119 120 121 122 |
|
validateName
async
¶
validateName(name)
Args:
Returns:
Source code in tm_admin/organizations/api.py
124 125 126 127 128 129 130 131 132 133 134 135 |
|
validateUser
async
¶
validateUser(name)
Args:
Returns:
Source code in tm_admin/organizations/api.py
137 138 139 140 141 142 143 144 145 146 147 148 |
|
main
async
¶
main()
This main function lets this class be run standalone by a bash script.
Source code in tm_admin/organizations/api.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
options: show_source: false heading_level: 3