Quote:
Originally Posted by chaley
Found it, I think. The inlined raw_field didn't handle None-valued fields properly.
If you are willing, try using this code:
Code:
def do_node_raw_field(self, prog):
try:
name = self.expr(prog.expression)
res = getattr(self.parent_book, name, None)
if res is not None:
if isinstance(res, list):
fm = self.parent_book.metadata_for_field(name)
if fm is None:
return ', '.join(res)
return fm['is_multiple']['list_to_ui'].join(res)
return unicode_type(res)
except ValueError as e:
raise e
except:
self.error(_('Unknown field {0}').format('parse error'))
It goes in utils.formatter.py, replacing the existing method starting at line 387.
EDIT: Kovid accepted the change. It is in source now.
|
I updated the source, and it no longer gives an error. But, with the column template as just "{:'raw_field('#pages')'}", I get the word "None". I was expecting an empty string, but, I don't remember what it was before.