Re: [Zope] dollars-and-cents display fails

2005-05-14 Thread Greg Fischer
http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html
That's it right there!  Before 5.0.3, they were unpacked, meaning
saved like a char.  Now they are packed, fixed point numbers.  This is
screwing up the python functions for fmt.

Well, I was trying to NOT redo all that code, but looks like I will
have to if I want to run the new mysql.  I have tons of reports using
dtml and fmt.   I think I'll stick with 5.0.0 for now until I have
time for that. (spent it all trying to figure out where my problem
was!)

Though, I might just switch to Firebird if I have to do some code
changing on my app anyway.  It's a bit more mature than Mysql's new
stuff. (considering it's still in beta)  Mysql is just so easy.

-



On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 ok, lots of testing, and I have found that this is related to Mysql 5.0.4.
 
 I compiled and installed Mysql 5.0.0 and the problem does not exist. I
 guess means that it started in 5.0.1 or higher.  I read through the
 change logs and saw a couple of items related to float values on 5.0.3
 and 5.0.4, but I dont have any idea if those are causing the issue.
 
 So, I dont know where to go next.  I can post this info on the mysql
 lists, but I only see the problem in Zope.  Python, or at least the
 MysqlDA, retrieves the value just fine.  I only get the problem if
 using a fmt option on Zope.
 Here's a recap:
 -- I can use Zope 2.7.4 with Mysql 5.0.4 on Windows (using Egenix ODBC
 DA) and there is no issue.
 -- I can use Zope 2.7.3 with Mysql 5.0.0 on Linux (Zmysqlda 2.0.9b3,
 Mysql-python1.2.0,Python 2.3.4) and there is no issue.
 -- When using Zope 2.7.3 with same setup as before, but with Mysql
 5.0.4, problem exists.
 -- Zope 2.7.6 has same issue.
 
 I tried doing a simple dtml:
 dtml-call REQUEST.set('dec',10.23)
 dtml-var decbr
 dtml-var dec fmt=dollars-and-centsbr
 
 This works just fine.  But when pulling 'dec' from Mysql, dtml wont
 render it if using fmt.
 
 I dont have to use Mysql 5.x.  It's just that I already have the app
 running on it, and I'd like to start testing the stored procedures and
 other useful features.
 
 Sorry for the long post.  I just want to give as much info as
 possible.  Thank you for any help!
 
 Greg
 
 
 On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
  Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
  mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
  package installed, but I have Python 2.3.4 compiled and installed
  separately for Zope.  Zope is compiled with the --with-python flag.
 
  Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
  float' line, restart Zope, still have the issue.
 
  So, I have the older Python, which I used to have.  I could try
  loading an older Zope, but what I might try is loading the MySQL
  5.0.0, which I had before.  At least I can hopefully find out which is
  causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
  it works fine, but on Windows using the Egenix adapter.  Now, I cant
  remember what I had for the mysql-python version, it's on the other
  server at my clients site. (cant get to it right now)
 
  I guess one of my main questions too is, would Zope be getting
  anything from the 2.4.1 Ubuntu packages that are installed if I
  compiled it with the 2.3.4 python?  (mysql-python is installed
  correctly on 2.3.4 too)
 
  On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
   On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
didnt want to move to 2.4.x as I think I read something in the README
for Zope stating it was not tested for compatibility. (right?)  I
guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding
the decimals?  For now, I am just going to setup 2.3.4 and run with
it.
  
   The Python decimal type is new in 2.4.
  
   I don't think you've actually said whether or not you are actually
   using a DECIMAL column.
  
   I had forgotten that ZMySQLDA-2.0.9b3 always returns DECIMAL columns
   as Python float. If you look in ZMySQLDA/db.py, you can see where it
   does this in the DB class. You could try commenting this line out,
   which will cause it to be returned as a string, and restarting Zope.
   It's something to try, at least.
   --
   Computer interfaces should never be made of meat.
   http://www.terrybisson.com/meat.html
   ___
   Zope maillist  -  Zope@zope.org
   http://mail.zope.org/mailman/listinfo/zope
   **   No cross posts or HTML encoding!  **
   (Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )
  
 
  --
  Greg Fischer
  1st Byte Solutions
  http://www.1stbyte.com
 
 
 --
 Greg Fischer
 1st Byte Solutions
 http://www.1stbyte.com
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com

Re: [Zope] dollars-and-cents display fails

2005-05-14 Thread Greg Fischer
OK well, I fixed it. At least on My zope server.

The function for dollars-and-cents in DT_Var.py was like this:
def dollars_and_cents(v, name='(Unknown name)', md={}):
   try: return $%.2f % v
   except: return ''

I changed it to this:
def dollars_and_cents(v, name='(Unknown name)', md={}):
   try: return $%.2f % float(v)
   except: return ''

Problem solved.  I just tested it in Mysql 5.0.0 and 5.0.4, and it
works great.  I'll setup the rest of my app and test some more to make
sure I am not missing something. If there are any problems I'll post
more details.

Is this something that could be posted on the Zope Collector?  It
should probably be tested on lots of other Db's I bet.  But, one
question I have, should this be handled in the Mysql DA?

On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html
 That's it right there!  Before 5.0.3, they were unpacked, meaning
 saved like a char.  Now they are packed, fixed point numbers.  This is
 screwing up the python functions for fmt.
 
 Well, I was trying to NOT redo all that code, but looks like I will
 have to if I want to run the new mysql.  I have tons of reports using
 dtml and fmt.   I think I'll stick with 5.0.0 for now until I have
 time for that. (spent it all trying to figure out where my problem
 was!)
 
 Though, I might just switch to Firebird if I have to do some code
 changing on my app anyway.  It's a bit more mature than Mysql's new
 stuff. (considering it's still in beta)  Mysql is just so easy.
 
 -
 
 
 On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
  ok, lots of testing, and I have found that this is related to Mysql 5.0.4.
 
  I compiled and installed Mysql 5.0.0 and the problem does not exist. I
  guess means that it started in 5.0.1 or higher.  I read through the
  change logs and saw a couple of items related to float values on 5.0.3
  and 5.0.4, but I dont have any idea if those are causing the issue.
 
  So, I dont know where to go next.  I can post this info on the mysql
  lists, but I only see the problem in Zope.  Python, or at least the
  MysqlDA, retrieves the value just fine.  I only get the problem if
  using a fmt option on Zope.
  Here's a recap:
  -- I can use Zope 2.7.4 with Mysql 5.0.4 on Windows (using Egenix ODBC
  DA) and there is no issue.
  -- I can use Zope 2.7.3 with Mysql 5.0.0 on Linux (Zmysqlda 2.0.9b3,
  Mysql-python1.2.0,Python 2.3.4) and there is no issue.
  -- When using Zope 2.7.3 with same setup as before, but with Mysql
  5.0.4, problem exists.
  -- Zope 2.7.6 has same issue.
 
  I tried doing a simple dtml:
  dtml-call REQUEST.set('dec',10.23)
  dtml-var decbr
  dtml-var dec fmt=dollars-and-centsbr
 
  This works just fine.  But when pulling 'dec' from Mysql, dtml wont
  render it if using fmt.
 
  I dont have to use Mysql 5.x.  It's just that I already have the app
  running on it, and I'd like to start testing the stored procedures and
  other useful features.
 
  Sorry for the long post.  I just want to give as much info as
  possible.  Thank you for any help!
 
  Greg
 
 
  On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
   Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
   mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
   package installed, but I have Python 2.3.4 compiled and installed
   separately for Zope.  Zope is compiled with the --with-python flag.
  
   Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
   float' line, restart Zope, still have the issue.
  
   So, I have the older Python, which I used to have.  I could try
   loading an older Zope, but what I might try is loading the MySQL
   5.0.0, which I had before.  At least I can hopefully find out which is
   causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
   it works fine, but on Windows using the Egenix adapter.  Now, I cant
   remember what I had for the mysql-python version, it's on the other
   server at my clients site. (cant get to it right now)
  
   I guess one of my main questions too is, would Zope be getting
   anything from the 2.4.1 Ubuntu packages that are installed if I
   compiled it with the 2.3.4 python?  (mysql-python is installed
   correctly on 2.3.4 too)
  
   On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
 Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
 didnt want to move to 2.4.x as I think I read something in the README
 for Zope stating it was not tested for compatibility. (right?)  I
 guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding
 the decimals?  For now, I am just going to setup 2.3.4 and run with
 it.
   
The Python decimal type is new in 2.4.
   
I don't think you've actually said whether or not you are actually
using a DECIMAL column.
   
I had forgotten that ZMySQLDA-2.0.9b3 always returns DECIMAL columns
 

Re: [Zope] dollars-and-cents display fails

2005-05-14 Thread Tino Wildenhain
Am Freitag, den 13.05.2005, 23:42 -0700 schrieb Greg Fischer:
 http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html
 That's it right there!  Before 5.0.3, they were unpacked, meaning
 saved like a char.  Now they are packed, fixed point numbers.  This is
 screwing up the python functions for fmt.
 
 Well, I was trying to NOT redo all that code, but looks like I will
 have to if I want to run the new mysql.  I have tons of reports using
 dtml and fmt.   I think I'll stick with 5.0.0 for now until I have
 time for that. (spent it all trying to figure out where my problem
 was!)
 
 Though, I might just switch to Firebird if I have to do some code
 changing on my app anyway.  It's a bit more mature than Mysql's new
 stuff. (considering it's still in beta)  Mysql is just so easy.

Maybe postgres is an option too? At least its a bit more
mature and doesnt have problems with high concurrency.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-14 Thread Greg Fischer
I guess my quick fix wont work.  Well, it fixes the fmt for decimals,
but there's more to the issue.  Statistical summaries, total, sum dont
work either.
In my dtml-in I might have this:
dtml-var total-decimalcolumn
or
dtml-var sum-decimalcolumn

These dont work with Mysql 5.0.4.  So, what do we have to change in
the Mysql DA or maybe the Mysql-python to fix this?

If I find anything, I'll post more.

On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 OK well, I fixed it. At least on My zope server.
 
 The function for dollars-and-cents in DT_Var.py was like this:
 def dollars_and_cents(v, name='(Unknown name)', md={}):
try: return $%.2f % v
except: return ''
 
 I changed it to this:
 def dollars_and_cents(v, name='(Unknown name)', md={}):
try: return $%.2f % float(v)
except: return ''
 
 Problem solved.  I just tested it in Mysql 5.0.0 and 5.0.4, and it
 works great.  I'll setup the rest of my app and test some more to make
 sure I am not missing something. If there are any problems I'll post
 more details.
 
 Is this something that could be posted on the Zope Collector?  It
 should probably be tested on lots of other Db's I bet.  But, one
 question I have, should this be handled in the Mysql DA?
 
 On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
  http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html
  That's it right there!  Before 5.0.3, they were unpacked, meaning
  saved like a char.  Now they are packed, fixed point numbers.  This is
  screwing up the python functions for fmt.
 
  Well, I was trying to NOT redo all that code, but looks like I will
  have to if I want to run the new mysql.  I have tons of reports using
  dtml and fmt.   I think I'll stick with 5.0.0 for now until I have
  time for that. (spent it all trying to figure out where my problem
  was!)
 
  Though, I might just switch to Firebird if I have to do some code
  changing on my app anyway.  It's a bit more mature than Mysql's new
  stuff. (considering it's still in beta)  Mysql is just so easy.
 
  -
 
 
  On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
   ok, lots of testing, and I have found that this is related to Mysql 5.0.4.
  
   I compiled and installed Mysql 5.0.0 and the problem does not exist. I
   guess means that it started in 5.0.1 or higher.  I read through the
   change logs and saw a couple of items related to float values on 5.0.3
   and 5.0.4, but I dont have any idea if those are causing the issue.
  
   So, I dont know where to go next.  I can post this info on the mysql
   lists, but I only see the problem in Zope.  Python, or at least the
   MysqlDA, retrieves the value just fine.  I only get the problem if
   using a fmt option on Zope.
   Here's a recap:
   -- I can use Zope 2.7.4 with Mysql 5.0.4 on Windows (using Egenix ODBC
   DA) and there is no issue.
   -- I can use Zope 2.7.3 with Mysql 5.0.0 on Linux (Zmysqlda 2.0.9b3,
   Mysql-python1.2.0,Python 2.3.4) and there is no issue.
   -- When using Zope 2.7.3 with same setup as before, but with Mysql
   5.0.4, problem exists.
   -- Zope 2.7.6 has same issue.
  
   I tried doing a simple dtml:
   dtml-call REQUEST.set('dec',10.23)
   dtml-var decbr
   dtml-var dec fmt=dollars-and-centsbr
  
   This works just fine.  But when pulling 'dec' from Mysql, dtml wont
   render it if using fmt.
  
   I dont have to use Mysql 5.x.  It's just that I already have the app
   running on it, and I'd like to start testing the stored procedures and
   other useful features.
  
   Sorry for the long post.  I just want to give as much info as
   possible.  Thank you for any help!
  
   Greg
  
  
   On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
package installed, but I have Python 2.3.4 compiled and installed
separately for Zope.  Zope is compiled with the --with-python flag.
   
Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
float' line, restart Zope, still have the issue.
   
So, I have the older Python, which I used to have.  I could try
loading an older Zope, but what I might try is loading the MySQL
5.0.0, which I had before.  At least I can hopefully find out which is
causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
it works fine, but on Windows using the Egenix adapter.  Now, I cant
remember what I had for the mysql-python version, it's on the other
server at my clients site. (cant get to it right now)
   
I guess one of my main questions too is, would Zope be getting
anything from the 2.4.1 Ubuntu packages that are installed if I
compiled it with the 2.3.4 python?  (mysql-python is installed
correctly on 2.3.4 too)
   
On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
 On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
  Thanks Andy.  I do have those versions.  But 

Re: [Zope] dollars-and-cents display fails

2005-05-14 Thread David H
Greg Fischer wrote:
I guess my quick fix wont work.  Well, it fixes the fmt for decimals,
but there's more to the issue.  Statistical summaries, total, sum dont
work either.
In my dtml-in I might have this:
dtml-var total-decimalcolumn
or
dtml-var sum-decimalcolumn
These dont work with Mysql 5.0.4.  So, what do we have to change in
the Mysql DA or maybe the Mysql-python to fix this?
If I find anything, I'll post more.
On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 

OK well, I fixed it. At least on My zope server.
The function for dollars-and-cents in DT_Var.py was like this:
def dollars_and_cents(v, name='(Unknown name)', md={}):
  try: return $%.2f % v
  except: return ''
I changed it to this:
def dollars_and_cents(v, name='(Unknown name)', md={}):
  try: return $%.2f % float(v)
  except: return ''
Problem solved.  I just tested it in Mysql 5.0.0 and 5.0.4, and it
works great.  I'll setup the rest of my app and test some more to make
sure I am not missing something. If there are any problems I'll post
more details.
Is this something that could be posted on the Zope Collector?  It
should probably be tested on lots of other Db's I bet.  But, one
question I have, should this be handled in the Mysql DA?
On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
   

http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html
That's it right there!  Before 5.0.3, they were unpacked, meaning
saved like a char.  Now they are packed, fixed point numbers.  This is
screwing up the python functions for fmt.
Well, I was trying to NOT redo all that code, but looks like I will
have to if I want to run the new mysql.  I have tons of reports using
dtml and fmt.   I think I'll stick with 5.0.0 for now until I have
time for that. (spent it all trying to figure out where my problem
was!)
Though, I might just switch to Firebird if I have to do some code
changing on my app anyway.  It's a bit more mature than Mysql's new
stuff. (considering it's still in beta)  Mysql is just so easy.
-
On 5/13/05, Greg Fischer [EMAIL PROTECTED] wrote:
 

ok, lots of testing, and I have found that this is related to Mysql 5.0.4.
I compiled and installed Mysql 5.0.0 and the problem does not exist. I
guess means that it started in 5.0.1 or higher.  I read through the
change logs and saw a couple of items related to float values on 5.0.3
and 5.0.4, but I dont have any idea if those are causing the issue.
So, I dont know where to go next.  I can post this info on the mysql
lists, but I only see the problem in Zope.  Python, or at least the
MysqlDA, retrieves the value just fine.  I only get the problem if
using a fmt option on Zope.
Here's a recap:
-- I can use Zope 2.7.4 with Mysql 5.0.4 on Windows (using Egenix ODBC
DA) and there is no issue.
-- I can use Zope 2.7.3 with Mysql 5.0.0 on Linux (Zmysqlda 2.0.9b3,
Mysql-python1.2.0,Python 2.3.4) and there is no issue.
-- When using Zope 2.7.3 with same setup as before, but with Mysql
5.0.4, problem exists.
-- Zope 2.7.6 has same issue.
I tried doing a simple dtml:
dtml-call REQUEST.set('dec',10.23)
dtml-var decbr
dtml-var dec fmt=dollars-and-centsbr
This works just fine.  But when pulling 'dec' from Mysql, dtml wont
render it if using fmt.
I dont have to use Mysql 5.x.  It's just that I already have the app
running on it, and I'd like to start testing the stored procedures and
other useful features.
Sorry for the long post.  I just want to give as much info as
possible.  Thank you for any help!
Greg
On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
   

Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
package installed, but I have Python 2.3.4 compiled and installed
separately for Zope.  Zope is compiled with the --with-python flag.
Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
float' line, restart Zope, still have the issue.
So, I have the older Python, which I used to have.  I could try
loading an older Zope, but what I might try is loading the MySQL
5.0.0, which I had before.  At least I can hopefully find out which is
causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
it works fine, but on Windows using the Egenix adapter.  Now, I cant
remember what I had for the mysql-python version, it's on the other
server at my clients site. (cant get to it right now)
I guess one of my main questions too is, would Zope be getting
anything from the 2.4.1 Ubuntu packages that are installed if I
compiled it with the 2.3.4 python?  (mysql-python is installed
correctly on 2.3.4 too)
On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
 

On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
   

Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
didnt want to move to 2.4.x as I think I read something in the README
for Zope stating it was not tested for compatibility. (right?)  I
guess my thought is... Does 2.3.5 have the same issue as 2.4 

Re: [Zope] dollars-and-cents display fails

2005-05-14 Thread Andy Dustman
On 5/14/05, David H [EMAIL PROTECTED] wrote:
 Greg,
 Have you contacted the mySQL product maintainer?  This is not a Zope
 community issue.  Which is to say, many of us have the instinct to help
 but simply do not use mySQL and therefore have nothing to suggest.
 Other than what is obvious:
 a) contact the maintainer
 b) consider changing to a well-maintained data adapater.

Ouch. But I guess if you'd followed the thread, you'd know the answer
to your question...

-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-13 Thread Greg Fischer
ok, lots of testing, and I have found that this is related to Mysql 5.0.4.

I compiled and installed Mysql 5.0.0 and the problem does not exist. I
guess means that it started in 5.0.1 or higher.  I read through the
change logs and saw a couple of items related to float values on 5.0.3
and 5.0.4, but I dont have any idea if those are causing the issue.

So, I dont know where to go next.  I can post this info on the mysql
lists, but I only see the problem in Zope.  Python, or at least the
MysqlDA, retrieves the value just fine.  I only get the problem if
using a fmt option on Zope.
Here's a recap: 
-- I can use Zope 2.7.4 with Mysql 5.0.4 on Windows (using Egenix ODBC
DA) and there is no issue.
-- I can use Zope 2.7.3 with Mysql 5.0.0 on Linux (Zmysqlda 2.0.9b3,
Mysql-python1.2.0,Python 2.3.4) and there is no issue.
-- When using Zope 2.7.3 with same setup as before, but with Mysql
5.0.4, problem exists.
-- Zope 2.7.6 has same issue.

I tried doing a simple dtml:
dtml-call REQUEST.set('dec',10.23)
dtml-var decbr
dtml-var dec fmt=dollars-and-centsbr

This works just fine.  But when pulling 'dec' from Mysql, dtml wont
render it if using fmt.

I dont have to use Mysql 5.x.  It's just that I already have the app
running on it, and I'd like to start testing the stored procedures and
other useful features.

Sorry for the long post.  I just want to give as much info as
possible.  Thank you for any help!

Greg



On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
 Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
 mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
 package installed, but I have Python 2.3.4 compiled and installed
 separately for Zope.  Zope is compiled with the --with-python flag.
 
 Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
 float' line, restart Zope, still have the issue.
 
 So, I have the older Python, which I used to have.  I could try
 loading an older Zope, but what I might try is loading the MySQL
 5.0.0, which I had before.  At least I can hopefully find out which is
 causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
 it works fine, but on Windows using the Egenix adapter.  Now, I cant
 remember what I had for the mysql-python version, it's on the other
 server at my clients site. (cant get to it right now)
 
 I guess one of my main questions too is, would Zope be getting
 anything from the 2.4.1 Ubuntu packages that are installed if I
 compiled it with the 2.3.4 python?  (mysql-python is installed
 correctly on 2.3.4 too)
 
 On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
  On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
   Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
   didnt want to move to 2.4.x as I think I read something in the README
   for Zope stating it was not tested for compatibility. (right?)  I
   guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding
   the decimals?  For now, I am just going to setup 2.3.4 and run with
   it.
 
  The Python decimal type is new in 2.4.
 
  I don't think you've actually said whether or not you are actually
  using a DECIMAL column.
 
  I had forgotten that ZMySQLDA-2.0.9b3 always returns DECIMAL columns
  as Python float. If you look in ZMySQLDA/db.py, you can see where it
  does this in the DB class. You could try commenting this line out,
  which will cause it to be returned as a string, and restarting Zope.
  It's something to try, at least.
  --
  Computer interfaces should never be made of meat.
  http://www.terrybisson.com/meat.html
  ___
  Zope maillist  -  Zope@zope.org
  http://mail.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope-dev )
 
 
 --
 Greg Fischer
 1st Byte Solutions
 http://www.1stbyte.com
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] dollars-and-cents display fails

2005-05-12 Thread Greg Fischer
Hi all,

I just moved my zope app from 2.7.3 to 2.7.6, plus the mysql db from
5.0.0 to 5.0.4.  After moving everything, I noticed all of my decimal
fields that will no longer display their values in DTML unless I
remove the dollars-and-cents fmt option.

I tried all kinds of things in mysql thinking that was it because I
knew there have been some major changes in that, but I couldnt find
anything there.  I tested a query from the mysql connection test, and
it retrieves the values fine.

Then I noticed, if I remove the fmt=dollars-and-cents, it would
work. Any thoughts on why this is?  Is it a security option on the
folder or other items?

I could just remove all the formatting, but I'd rather not.  Thanks
for any help!
-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-12 Thread Greg Fischer
Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
didnt want to move to 2.4.x as I think I read something in the README
for Zope stating it was not tested for compatibility. (right?)  I
guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding
the decimals?  For now, I am just going to setup 2.3.4 and run with
it.

I am assuming that you are the same adustman on the mysql-python
project?  Nice job on that, very cool stuff!


On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
 On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
  I just moved my zope app from 2.7.3 to 2.7.6, plus the mysql db from
  5.0.0 to 5.0.4.  After moving everything, I noticed all of my decimal
  fields that will no longer display their values in DTML unless I
  remove the dollars-and-cents fmt option.
 
 What version of MySQL-python and ZMySQLDA are you using? For
 MySQL-5.0, you definitely need MySQL-python-1.2.0 or newer and
 ZMySQLDA-2.0.9b3. You aren't using Python-2.4 by any chance, are you?
 2.4 has a decimal type, which MySQL-python will make use of, if it's
 there, and the DECIMAL columns are returned using the Python decimal
 type. Previously they would have been returned as strings, and that
 might account for your breakage.
 
 --
 Computer interfaces should never be made of meat.
 http://www.terrybisson.com/meat.html
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-12 Thread Jens Vagelpohl
On May 13, 2005, at 03:21, Greg Fischer wrote:
Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
didnt want to move to 2.4.x as I think I read something in the README
for Zope stating it was not tested for compatibility. (right?)
Yes, that is correct. Do not use it if you expect anyone here to help  
with problems you encounter.

jens
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-12 Thread Greg Fischer
Darn!  That didnt fix it.  I just setup python 2.3.4, setup Zope 2.7.6
again, along with mysql-python 1.2.0 and ZMySQLDA-2.0.9b3, and
fmt=dollars-and-cents will not display the data.  Also, I tried just
using the c-style formatting: fmt=$%.2f and I have a different
issue, I get a Type Error - float argument required.  So how do I fix
this decimal or string issue?  Is there something on MySQL needing
setup differently? (which is 5.0.4beta)  Seems more like Python or
Zope issue.

Any ideas to get me in the right direction?

Thanks!


On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
 On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
  I just moved my zope app from 2.7.3 to 2.7.6, plus the mysql db from
  5.0.0 to 5.0.4.  After moving everything, I noticed all of my decimal
  fields that will no longer display their values in DTML unless I
  remove the dollars-and-cents fmt option.
 
 What version of MySQL-python and ZMySQLDA are you using? For
 MySQL-5.0, you definitely need MySQL-python-1.2.0 or newer and
 ZMySQLDA-2.0.9b3. You aren't using Python-2.4 by any chance, are you?
 2.4 has a decimal type, which MySQL-python will make use of, if it's
 there, and the DECIMAL columns are returned using the Python decimal
 type. Previously they would have been returned as strings, and that
 might account for your breakage.
 
 --
 Computer interfaces should never be made of meat.
 http://www.terrybisson.com/meat.html
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-12 Thread Andy Dustman
On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
 Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
 didnt want to move to 2.4.x as I think I read something in the README
 for Zope stating it was not tested for compatibility. (right?)  I
 guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding
 the decimals?  For now, I am just going to setup 2.3.4 and run with
 it.

The Python decimal type is new in 2.4.

I don't think you've actually said whether or not you are actually
using a DECIMAL column.

I had forgotten that ZMySQLDA-2.0.9b3 always returns DECIMAL columns
as Python float. If you look in ZMySQLDA/db.py, you can see where it
does this in the DB class. You could try commenting this line out,
which will cause it to be returned as a string, and restarting Zope.
It's something to try, at least.
-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dollars-and-cents display fails

2005-05-12 Thread Greg Fischer
Oh, it is a decimal(15,2) column.  (all of them are)  Just thought I'd
mention everything too... Running Ubuntu 5.0.4, has the Python 2.4.1
package installed, but I have Python 2.3.4 compiled and installed
separately for Zope.  Zope is compiled with the --with-python flag.

Just tried your suggestion, commenting the 'conv[FIELD_TYPE.DECIMAL] =
float' line, restart Zope, still have the issue.

So, I have the older Python, which I used to have.  I could try
loading an older Zope, but what I might try is loading the MySQL
5.0.0, which I had before.  At least I can hopefully find out which is
causing my problem.  However, I have Zope 2.7.4 with MySQL 5.0.4 and
it works fine, but on Windows using the Egenix adapter.  Now, I cant
remember what I had for the mysql-python version, it's on the other
server at my clients site. (cant get to it right now)

I guess one of my main questions too is, would Zope be getting
anything from the 2.4.1 Ubuntu packages that are installed if I
compiled it with the 2.3.4 python?  (mysql-python is installed
correctly on 2.3.4 too)

On 5/12/05, Andy Dustman [EMAIL PROTECTED] wrote:
 On 5/12/05, Greg Fischer [EMAIL PROTECTED] wrote:
  Thanks Andy.  I do have those versions.  But Python is 2.3.5 because I
  didnt want to move to 2.4.x as I think I read something in the README
  for Zope stating it was not tested for compatibility. (right?)  I
  guess my thought is... Does 2.3.5 have the same issue as 2.4 regarding
  the decimals?  For now, I am just going to setup 2.3.4 and run with
  it.
 
 The Python decimal type is new in 2.4.
 
 I don't think you've actually said whether or not you are actually
 using a DECIMAL column.
 
 I had forgotten that ZMySQLDA-2.0.9b3 always returns DECIMAL columns
 as Python float. If you look in ZMySQLDA/db.py, you can see where it
 does this in the DB class. You could try commenting this line out,
 which will cause it to be returned as a string, and restarting Zope.
 It's something to try, at least.
 --
 Computer interfaces should never be made of meat.
 http://www.terrybisson.com/meat.html
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )