X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/2fee7534634e0f96094500811ae88b2bfae94fc6..a04865183fefdd58b0de1cea7c69a9b04a408e53:/pokedex/db/markdown.py diff --git a/pokedex/db/markdown.py b/pokedex/db/markdown.py index 616830a..257c8de 100644 --- a/pokedex/db/markdown.py +++ b/pokedex/db/markdown.py @@ -106,6 +106,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 @@ -113,4 +116,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)