def _yield_form_strings(self):
        if self.data is None:
            raise Exception("No data?")

        for form_dict in self.data["forms"]:
            name = form_dict["name"]
            name_with_spaces = de_camelcase(name)

            comment = None
            yield comment, name_with_spaces

            # the header is html ...
            # header_html = form_dict["header"]
            # todo extract strings from header
            yield None, None
            yield from self._yield_section_strings(form_dict)
Exemple #2
0
def nice_name(name):
    try:
        return de_camelcase(name)
    except BaseException:
        return name
Exemple #3
0
 def display(form_or_formset, field, error):
     form_name = form_or_formset.__class__.__name__.replace("Form",
                                                            "").replace(
                                                                "Set", "")
     return "%s %s: %s" % (de_camelcase(form_name), field.replace(
         "_", " "), error)