marshall_webapp.models.transients_akas.models_transients_akas_get module ∞
The model get for the ``models_transients_akas_get.py`` resource
- Author
David Young
-
class
models_transients_akas_get
(log, request, elementId=False, search=False)[source] ∞ Bases:
dryxPyramid.models.models_base.base_model
The worker class for the models_transients_akas_get module
Key Arguments
log
– loggerrequest
– the pyramid requestelementId
– the specific element id requests (or False)
Usage
usage code .. todo:: - add usage info - create a sublime snippet for usage - add a tutorial about ``models_transients_akas_get`` to documentation - create a blog post about what ``models_transients_akas_get`` does
-
get
()[source] ∞ execute the get method on the models_transients_akas_get object
Return
responseContent
– the reponse to send to the browser
-
convert_to_nested_data_structure
(listOfDict, primaryKey, resourceName, resourceKeys)[source] ∞ given a flat list of dictionaries, converts and returns the content in a nested structure better suited for json rendering
Key Arguments
listOfDict
– the list of dictionaries (generally returned from a database query)primaryKey
– the primary key in the result sets by which to group json results byresourceName
– the name of the subresource belong to be collected togetherresourceKeys
– the name of the keys to be grouped together under the subresource
Usage
Here’s an example usage of this method:
responseContent = self.convert_to_nested_data_structure( listOfDict=rows, primaryKey="transientBucketId", resourceName="akas", resourceKeys=["name", "url"] )