From 6f5502f709a5e4b12950cd0f9d7068ee3d083547 Mon Sep 17 00:00:00 2001 From: Dingyuan Wang Date: Fri, 25 Aug 2017 15:05:50 +0800 Subject: [PATCH] fix text_factory local config --- README.rst | 1 + bottle_sqlite.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1d0047f..01c863b 100644 --- a/README.rst +++ b/README.rst @@ -67,6 +67,7 @@ The following configuration options exist for the plugin class: * **keyword**: The keyword argument name that triggers the plugin (default: 'db'). * **autocommit**: Whether or not to commit outstanding transactions at the end of the request cycle (default: True). * **dictrows**: Whether or not to support dict-like access to row objects (default: True). +* **text_factory**: The text_factory for the connection (default: unicode). You can override each of these values on a per-route basis:: diff --git a/bottle_sqlite.py b/bottle_sqlite.py index c4014a9..62cb826 100755 --- a/bottle_sqlite.py +++ b/bottle_sqlite.py @@ -98,7 +98,7 @@ class SQLitePlugin(object): autocommit = g('autocommit', self.autocommit) dictrows = g('dictrows', self.dictrows) keyword = g('keyword', self.keyword) - text_factory = g('keyword', self.text_factory) + text_factory = g('text_factory', self.text_factory) # Test if the original callback accepts a 'db' keyword. # Ignore it if it does not need a database handle.