Author: reinhard Date: 2008-07-10 15:09:21 -0500 (Thu, 10 Jul 2008) New Revision: 9885
Modified: trunk/gnue-common/src/utils/datatypes.py Log: Use new iso8601 module. Modified: trunk/gnue-common/src/utils/datatypes.py =================================================================== --- trunk/gnue-common/src/utils/datatypes.py 2008-07-10 20:00:43 UTC (rev 9884) +++ trunk/gnue-common/src/utils/datatypes.py 2008-07-10 20:09:21 UTC (rev 9885) @@ -29,7 +29,7 @@ import datetime import mx.DateTime -from gnue.common.utils import GDateTime +from gnue.common.lib import iso8601 # ============================================================================= @@ -80,7 +80,7 @@ elif datatype == "date": if isinstance(value, basestring): - value = GDateTime.parseISO(value) + value = iso8601.parse_iso(value) if isinstance(value, datetime.datetime): result = value.date() @@ -96,7 +96,7 @@ elif datatype == "time": if isinstance(value, basestring): - value = GDateTime.parseISO(value) + value = iso8601.parse_iso(value) if isinstance(value, datetime.datetime): result = value.time() @@ -117,7 +117,7 @@ elif datatype == "datetime": if isinstance(value, basestring): - value = GDateTime.parseISO(value) + value = iso8601.parse_iso(value) if isinstance(value, datetime.datetime): result = value @@ -205,6 +205,6 @@ print repr(convert('abc', 'text', 0, 0)) print repr(convert('123', 'number', 0, 0)) print repr(convert(123, 'number', 10, 2)) - print repr(convert('2006-11-29', 'date', 0, 0)) + print repr(convert('2006-11-29 00:00:00', 'date', 0, 0)) print repr(convert('17:18:19', 'time', 0, 0)) print repr(convert(1, 'boolean', 0, 0)) _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue