def render_xhr_format(self, fs=None, **kwargs): html = Base.render_xhr_format(self, fs=fs, **kwargs) if fs and request.POST and 'field' not in request.GET: flash = Flash() if fs.errors: errors = [f.label() for f in fs.render_fields.values() if f.errors] flash.error('Field(s) %s have errors' % ','.join(errors)) else: flash.info('Record saved') html = literal(html) + flash.render() return html
def render_xhr_format(self, fs=None, **kwargs): html = Base.render_xhr_format(self, fs=fs, **kwargs) if fs and request.POST and 'field' not in request.GET: flash = Flash() if fs.errors: errors = [ f.label() for f in fs.render_fields.values() if f.errors ] flash.error('Field(s) %s have errors' % ','.join(errors)) else: flash.info('Record saved') html = literal(html) + flash.render() return html