Esempio n. 1
0
 def format_error(self, error):
     """ modify exception messages for prettified flashes """
     if isinstance(error, ValidationError):
         return '. '.join(itervalues(error.to_dict()))
     return as_unicode(error)
Esempio n. 2
0
def save_inline(form, model):
    for f in itervalues(form._fields):
        if f.type == 'InlineModelFormList':
            f.save_related(model)
Esempio n. 3
0
 def get_list(self, page, sort_field, sort_desc, search, filters):
     self.search_arguments.append(
         (page, sort_field, sort_desc, search, filters))
     return len(self.all_models), itervalues(self.all_models)
Esempio n. 4
0
 def get_list(self, page, sort_field, sort_desc, search, filters):
     self.search_arguments.append((page, sort_field, sort_desc, search, filters))
     return len(self.all_models), itervalues(self.all_models)
Esempio n. 5
0
def save_inline(form, model):
    for f in itervalues(form._fields):
        if f.type == 'InlineModelFormList':
            f.save_related(model)
Esempio n. 6
0
def format_error(error):
    if isinstance(error, ValidationError):
        return '. '.join(itervalues(error.to_dict()))

    return as_unicode(error)
Esempio n. 7
0
def format_error(error):
    if isinstance(error, ValidationError):
        return '. '.join(itervalues(error.to_dict()))

    return as_unicode(error)