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)
def nice_name(name): try: return de_camelcase(name) except BaseException: return name
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)