Initial tests for SQLCustomType

This commit is contained in:
ilvalle
2014-12-03 18:20:07 +01:00
parent 6228de8e10
commit f64098af14
2 changed files with 31 additions and 1 deletions
+1 -1
View File
@@ -1321,7 +1321,7 @@ class BaseAdapter(ConnectionPool):
obj = obj()
if isinstance(fieldtype, SQLCustomType):
value = fieldtype.encoder(obj)
if fieldtype.type in ('string','text', 'json'):
if value and fieldtype.type in ('string','text', 'json'):
return self.adapt(value)
return value or 'NULL'
if isinstance(obj, (Expression, Field)):