Beispiel #1
0
def list_all_forms(form_tuples, xform_base_url):
    template = env.get_template('form_list.xml')
    form_tuples = [(escape(form_name), form_id)
                   for form_name, form_id in form_tuples]
    return template.render(form_tuples=form_tuples,
                           xform_base_url=xform_base_url)
Beispiel #2
0
 def escape_option_text(self):
     for option in self._dict.get(self.OPTIONS):
         option['text'] = escape(option['text'])
Beispiel #3
0
 def options(self):
     return [(entity.short_code, escape(entity.data['name']['value']))
             for entity in get_all_entities(self.dbm, [self.unique_id_type])
             ]
Beispiel #4
0
def _get_entity_options(dbm, entity_type):
    return [(entity.short_code, escape(entity.data['name']['value'])) for entity in get_all_entities(dbm, [entity_type])]