projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
76c9787
)
Enable nullable MarkdownColumns
author
Petr Viktorin
<encukou@gmail.com>
Sun, 3 Apr 2011 16:42:46 +0000
(19:42 +0300)
committer
Petr Viktorin
<encukou@gmail.com>
Sun, 3 Apr 2011 17:08:04 +0000
(20:08 +0300)
pokedex/db/markdown.py
patch
|
blob
|
history
diff --git
a/pokedex/db/markdown.py
b/pokedex/db/markdown.py
index
616830a
..
257c8de
100644
(file)
--- 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)