From 9dd936c95bb13b4cf8da055a28d57c32fc2861e2 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 26 Feb 2007 22:27:14 +0000 Subject: [PATCH 1/1] =?utf8?q?Arreglar=20bug=20en=20ParamsValidator=20de?= =?utf8?q?=20ParamsCol.=20Ahora=20el=20validator=20de=20ParamsCol=20acepta?= =?utf8?q?=20a=20None=20como=20un=20valor=20permitido=20(y=20devuelve=20un?= =?utf8?q?a=20lista=20vac=C3=ADa).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- sercom/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sercom/model.py b/sercom/model.py index a3897ac..c01b63c 100644 --- a/sercom/model.py +++ b/sercom/model.py @@ -49,7 +49,7 @@ class TupleCol(PickleCol): class ParamsValidator(UnicodeStringValidator): def to_python(self, value, state): - if isinstance(value, basestring): + if isinstance(value, basestring) or value is None: value = super(ParamsValidator, self).to_python(value, state) try: value = params_to_list(value) @@ -64,7 +64,7 @@ class ParamsValidator(UnicodeStringValidator): def from_python(self, value, state): if isinstance(value, (list, tuple)): value = ' '.join([repr(p) for p in value]) - elif isinstance(value, basestring): + elif isinstance(value, basestring) or value is None: value = super(ParamsValidator, self).to_python(value, state) try: params_to_list(value) -- 2.43.0