Utils
- Activity Stream Utils
- DataHub Utils
dh_adviser_search()
dh_company_search()
dh_contact_create()
dh_enquiry_readiness()
dh_get_company_contact_list()
dh_get_matching_company_contact()
dh_get_matching_company_contact_by_email()
dh_get_user_details()
dh_investment_create()
dh_prepare_contact()
dh_prepare_payload()
dh_request()
fetch_metadata()
resolve_metadata_id()
- app.enquiries.utils.csv_row_to_enquiry_filter_kwargs(csv_row: dict) dict
Converts a CSV
row
into adict
representingapp.enquiries.models.Enquiry
query kwargs e.g.enquiry__enquirer__first_name
.- Parameters:
csv_row (dict) – The CSV row
- Returns:
dict
of queryset filter kwargs
- app.enquiries.utils.generate_import_template(file_obj)
Generates an XLSX spreadsheet for use by by IST team to capture enquiries.
The main enquiry sheet is used by end users to capture information. The enquiry sheet columns are listed in
app.enquiries.ref_data.IMPORT_COL_NAMES
.The additional sheets list valid options (i.e. Country names etc) which enable end users to implement their own form of validation.
The fields for these sheets are also listed in
app.enquiries.ref_data
- Parameters:
file_obj (file-like object) –
- app.enquiries.utils.get_oauth_payload(request)
Extracts the user’s OAuth 2.0 token from session
- Parameters:
request (django.http.HttpRequest) –
- app.enquiries.utils.parse_error_messages(e)
Takes an error and parses its messages in human-readable form.
Where there are message dictionaries, separates out each message, parsing the keys into sentence case with title capitalisations
- Parameters:
- Returns:
A list of error messages
- app.enquiries.utils.row_to_enquiry(row: dict) Enquiry
Converts a CSV
row
into a persistedapp.enquiries.models.Enquiry
instance.- Parameters:
row (dict) –
- Returns: