(self)
return format_key
Get a function that formats case property names

        The returned function requires two arguments
        `(case_property_name, data_path)` and returns a string.
Get a function that formats case property names
Get a function that formats case property names
def get_case_property_name_formatter(self):
        """Get a function that formats case property names

        The returned function requires two arguments
        `(case_property_name, data_path)` and returns a string.
        """
        valid_paths = {}
        if toggles.MM_CASE_PROPERTIES.enabled(self.get_app().domain):
            try:
                valid_paths = {question['value']: question['tag']
                               for question in self.get_questions(langs=[])}
            except XFormException:
                # punt on invalid xml (sorry, no rich attachments)
                valid_paths = {}

        def format_key(key, path):
            if valid_paths.get(path) == "upload":
                return "{}{}".format(ATTACHMENT_PREFIX, key)
            return key
        return format_key
def get_case_property_name_formatter ( self ) : valid_paths = { } if toggles . MM_CASE_PROPERTIES . enabled ( self . get_app ( ) . domain ) : try : valid_paths = { question [ 'value' ] : question [ 'tag' ] for question in self . get_questions ( langs = [ ] ) } except XFormException : # punt on invalid xml (sorry, no rich attachments) valid_paths = { } def format_key ( key , path ) : if valid_paths . get ( path ) == "upload" : return "{}{}" . format ( ATTACHMENT_PREFIX , key ) return key return format_key