Hello,
    I've just started looking at the effort to port our application
to the latest version of SQLObject and have found it to be broken
when it comes to type conversions.  I now get exceptions like
this:
  File "/usr/lib/python2.4/site-packages/sqlobject/col.py", line 968, in
to_python
    (self.format, self.name, type(value), value), value, state)
formencode.api.Invalid: expected an date/time string of the '%Y-%m-%d'
format in the DateTimeCol 'sourcedate', got <type 'str'> '2007-03-07
10:18:14' instead

Yep, truncating a timestamp into a date is a common operation, one the
DB (Postgres) performs flawlessly.

It also complains about strings of the form '070314', which may horrify
the Y2K purists, however; is still a very used, real, and valid form for
specifying a date.  It also complains about '20070314'.  Both forms
are converted just fine by the DB.

I haven't yet tripped over it however it would be a real problem if
the string '0.1020' were not passed as a string to the DB to populate
a decimal/numeric column, converting to a float results in really bad
things, especially working with money.

The final straw of course is this (NON)error:
  File "/usr/lib/python2.4/site-packages/sqlobject/col.py", line 592, in
from_python
    (self.name, type(value), value), value, state)
formencode.api.Invalid: expected an int in the IntCol 'id', got <type
'str'> '2' instead

Again the DB has no problem with the above.  However with the land-mines
now lade by SQLObject with it's (IMO un-pythonic) strict data typing
the effort to convert seems to not be worth it.

Is there any way to disable this undesirable behavior?

Thanks,
William.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to