X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/acb88ee169b9a8f255f2e72cca2cf6dc94fd02e8..c87f91105dbce6befb0d4b68c1d6b9bb2a69e805:/pokedex/db/markdown.py diff --git a/pokedex/db/markdown.py b/pokedex/db/markdown.py index 09f8067..c82ce68 100644 --- a/pokedex/db/markdown.py +++ b/pokedex/db/markdown.py @@ -112,6 +112,9 @@ class MarkdownColumn(sqlalchemy.types.TypeDecorator): impl = sqlalchemy.types.Unicode def process_bind_param(self, value, dialect): + if value is None: + return None + if not isinstance(value, basestring): # Can't assign, e.g., MarkdownString objects yet raise NotImplementedError @@ -119,4 +122,7 @@ class MarkdownColumn(sqlalchemy.types.TypeDecorator): return unicode(value) def process_result_value(self, value, dialect): + if value is None: + return None + return MarkdownString(value)