View Single Post
Old 05-14-2017, 12:05 PM   #188
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,495
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@chaley: From looking at the code, the best approach seems to be to allow TemplateFormatter to take an argument formatter_funcs which defaults to None. When None, it uses the global formatter_funcs, otherwise it uses the local one. Then have each db object keep its own copy of the formatter_funcs() with its funcs loaded. In get_metadata()/proxy_metadata() it will pass in a formatter to the Metadata() object that uses this copy instead of the gloabl formatter_funcs()

I could be way off base, however.
kovidgoyal is offline   Reply With Quote