[orm-devel] The NUMERIC problem float-ing around (no more!)
Diedrich Vorberg
orm-devel@mailman.tux4web.de
Sat, 7 Dec 2002 07:39:05 +0100
Hi Eric,
>Hey, that sounds like a nice solution. If I understand you correctly, I
>can choose to use the new numeric/Column type (and install and use
>FixedPoint) or I can choose to use customType and handle any needed
>conversions myself? I don't care to use FixedPoint ( I don't know
>anything about it, and I may change my mind later, but for now I crave
>simplicity ).
Not quite. You'd have to write your own datatype/column pair, which
probably isn't worth the effort.
>Is FixedPoint now a requirement of orm?
No it isn't. The import statement in orm.adapters.pgsql.datasource is
in a try: block and the except: will define a minimal class
FixedPoint which is a wraper around a Python string, really.
If you only want the NUMERIC data as a string and simply use float()
on it you can skip installing FixedPoint and use it this way. You
might want to take a look, though, doesn't seem too bad.
Perhaps I should have integrated the simple string functionality in
CustomType as a default behaviour.
Diedrich
--
_..._ Diedrich Vorberg
.' '.
/ _ _ \ http://www.tux4web.de
| (o)_(o) | info@tux4web.de
\( ) / .---.
//'._.'\ \ / \ Internet Dienstleistungen
// . \ \ \.@-@./ und 'Consulting'.
|| . \ \ /`\_/`\
|\ : / | // _ \\ Linux Rules!
\ `) ' (` /_ | \ )|_
_)``".____,.'"` (_ /`\_`> <_/ \
) )'--'( ( \__/'---'\__/
'---` `---`