Last active
September 26, 2022 17:43
-
-
Save ethanholda/e6cd5875561d2dc4d6cc399442c914c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## In CMA Tessitura Module, either add it to an existing class or create a new class/module | |
def post_custom_execute(self, procedure_id: int, procedure_name: str, **kwargs): | |
""" | |
Executes a custom procedure already registered in the Tessitura | |
Database. | |
""" | |
endpoint = "Custom/Execute" | |
params = { | |
"ProcedureId": procedure_id, | |
"ProcedureName": procedure_name | |
} | |
params.update(kwargs) | |
return self.post_tess_data(endpoint, params) | |
## Then in website-middleware, you can call this method from your middleware method to | |
## get the form data. | |
async def post_get_custom_form_data(keyword_id: int): | |
# get tessitura class object for the method. | |
# for now, we can hard code the procedure id, procedure name | |
# and the name of the param | |
procedure_id = 70 | |
procedure_name = 'LP_GET_CUSTOM_FORM_BY_Keyword_ID' | |
data = { | |
"Name": "keyword_id", | |
"Value": keyword_id | |
} | |
return tess_object.post_custom_execute(procedure_id, procedure_name, data) | |
## example call, custom form example | |
post_get_custom_form_data(686) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment