Hello all, I have successfully installed the PoPyDA product in Zope and am able to query existing PostgreSQL databses but am getting the following error when I try to INSERT a new record into the database: Error, exceptions.NameError: global name 'string' is not defined <snip/> File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 544, in __call__ (Object: <string>) File /usr/local/zope/lib/python/Shared/DC/ZRDB/sqlvar.py, line 206, in render (Object: job_num) File /usr/local/zope/lib/python/Products/zpopyda/PoPy_DA.py, line 103, in sql_quote__ (Object: RoleManager) NameError: (see above) I'm using the <dtml-sqlvar name type="string"> tag to insert the variables, which works fine when I use Gadfly. If anyone has any suggestions (or a FM I can R), I be most appreciative. Thanks, Matt Hand matt@bitflip.com
I'm in the same boat. When I was having trouble connecting to the PostgreSQL db, I got an interesting response from Thierry Michel, the author of of the PoPy adapter: look at the permissions on the database. Sure enough, I didn't have permission to make a local connection. I told you all of that so I could tell you this: I think this might be the same error: something may be wrong at the db level, and not with zope or the adapter. Of course, I have no idea what it could be, and I've checked a number of PostgreSQL docs to find out what could be the problem with "string" but nothing yet. I tried the "nb" type as well, and no go. I haven't done too much with the numeric types yet...maybe I'll test those to make sure they all work. But float does! Russell On Wednesday 22 August 2001 15:47, you wrote:
Hello all,
I have successfully installed the PoPyDA product in Zope and am able to query existing PostgreSQL databses but am getting the following error when I try to INSERT a new record into the database:
Error, exceptions.NameError: global name 'string' is not defined
<snip/>
File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 544, in __call__ (Object: <string>) File /usr/local/zope/lib/python/Shared/DC/ZRDB/sqlvar.py, line 206, in render (Object: job_num) File /usr/local/zope/lib/python/Products/zpopyda/PoPy_DA.py, line 103, in sql_quote__ (Object: RoleManager) NameError: (see above)
I'm using the <dtml-sqlvar name type="string"> tag to insert the variables, which works fine when I use Gadfly.
If anyone has any suggestions (or a FM I can R), I be most appreciative.
Thanks, Matt Hand matt@bitflip.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Russell Hires wrote:
I'm in the same boat. When I was having trouble connecting to the PostgreSQL db, I got an interesting response from Thierry Michel, the author of of the PoPy adapter: look at the permissions on the database. Sure enough, I didn't have permission to make a local connection.
I told you all of that so I could tell you this: I think this might be the same error: something may be wrong at the db level, and not with zope or the adapter. Of course, I have no idea what it could be, and I've checked a number of PostgreSQL docs to find out what could be the problem with "string" but nothing yet. I tried the "nb" type as well, and no go. I haven't done too much with the numeric types yet...maybe I'll test those to make sure they all work. But float does!
So..., what can we do?. I have been looking for information in some PostGreSQL docs, Python docs, Zope docs (ZSQL Method), but nothing. I´m sure it works for float and int types, but with string or nb, it doesn´t work. the error line in PoPy_DA.py is: find=string.find So, is it a "casting" problem of python, or PostGreSQL?. Are we going to use another db (MySQL, Gadfly (;-D), ...) to solve our problem? Who can say us something about how to solve the problem?. This a serious thread of Zope Mail. "To use, or not to use PostGreSQL, this is our question"
Russell On Wednesday 22 August 2001 15:47, you wrote:
Hello all,
I have successfully installed the PoPyDA product in Zope and am able to query existing PostgreSQL databses but am getting the following error when I try to INSERT a new record into the database:
Error, exceptions.NameError: global name 'string' is not defined
<snip/>
File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 544, in __call__ (Object: <string>) File /usr/local/zope/lib/python/Shared/DC/ZRDB/sqlvar.py, line 206, in render (Object: job_num) File /usr/local/zope/lib/python/Products/zpopyda/PoPy_DA.py, line 103, in sql_quote__ (Object: RoleManager) NameError: (see above)
I'm using the <dtml-sqlvar name type="string"> tag to insert the variables, which works fine when I use Gadfly.
If anyone has any suggestions (or a FM I can R), I be most appreciative.
Thanks, Matt Hand matt@bitflip.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Antonio JesÚS Carrasco GarcÍA wrote:
So..., what can we do?. I have been looking for information in some PostGreSQL docs, Python docs, Zope docs (ZSQL Method), but nothing. I´m sure it works for float and int types, but with string or nb, it doesn´t work. the error line in PoPy_DA.py is: find=string.find So, is it a "casting" problem of python, or PostGreSQL?. Are we going to use another db (MySQL, Gadfly (;-D), ...) to solve our problem? Who can say us something about how to solve the problem?.
This a serious thread of Zope Mail. "To use, or not to use PostGreSQL, this is our question"
wrong question... it should be "To use, or not to use PoPy, this is our question." We use Psycopg and have had no problems. http://initd.org/Software/psycopg/ -- Tom Jenkins devIS - Development Infostructure http://www.devis.com
No, we want to use PostgreSQL, it does transactions (very desirable). I'm not sure about the other DB adapter...I haven't really heard about it. Guess I'll check it out... Russell On Thursday 23 August 2001 16:08, you wrote:
Antonio JesÚS Carrasco GarcÍA wrote:
So..., what can we do?. I have been looking for information in some PostGreSQL docs, Python docs, Zope docs (ZSQL Method), but nothing. I´m sure it works for float and int types, but with string or nb, it doesn´t work. the error line in PoPy_DA.py is: find=string.find So, is it a "casting" problem of python, or PostGreSQL?. Are we going to use another db (MySQL, Gadfly (;-D), ...) to solve our problem? Who can say us something about how to solve the problem?.
This a serious thread of Zope Mail. "To use, or not to use PostGreSQL, this is our question"
wrong question... it should be "To use, or not to use PoPy, this is our question."
We use Psycopg and have had no problems. http://initd.org/Software/psycopg/
On Wed, Aug 22, 2001 at 09:46:01PM +0200, Antonio Jes?S Carrasco Garc?A wrote:
Russell Hires wrote:
I told you all of that so I could tell you this: I think this might be the same error: something may be wrong at the db level, and not with zope or the adapter. Of course, I have no idea what it could be, and I've checked a number of PostgreSQL docs to find out what could be the problem with "string" but nothing yet. I tried the "nb" type as well, and no go. I haven't done too much with the numeric types yet...maybe I'll test those to make sure they all work. But float does!
Antonio: Which PoPy, which ZPoPyDA? I can assure you that there are no such problems prior to 2.0.5, and I really suspect that there are no such problems in 2.0.7, although I don't have a machine at hand that I can safely test it on. (I will be able to test tonight). I suspect that the lack of response you are getting is because it is SO outside the experience of everyone else that no-one has the least clue of what is happening to you. Russell: are you also saying that you can now connect to your database and that ZSQL methods containing references to type=string are failing? Jim Penny
On Thu, Aug 23, 2001 at 04:30:48PM -0400, Jim Penny wrote:
Antonio:
Which PoPy, which ZPoPyDA?
I can assure you that there are no such problems prior to 2.0.5, and I really suspect that there are no such problems in 2.0.7, although I don't have a machine at hand that I can safely test it on. (I will be able to test tonight).
I suspect that the lack of response you are getting is because it is SO outside the experience of everyone else that no-one has the least clue of what is happening to you.
Russell: are you also saying that you can now connect to your database and that ZSQL methods containing references to type=string are failing?
Jim, Since I started this line of inquiry, I suppose I'd better step up. I have no problems accessing a PostgreSQL database with ZPoPyDA 2.0.7, Zope 2.4.0, and PostgreSQL 7.1.2 except when I try to INSERT values. Using the <dtml-sqlvar> tag requires a 'type' and when I set the type to 'string' it chokes with a name error: Error, exceptions.NameError: global name 'string' is not defined I have no better luck when using type="nb". However, I have no difficulty using PoPy within python scripts outside of Zope. Any light you can shed on the situation would be great. Thanks, Matt matt@bitflip.com
have you tried: <dtml-sqlvar something type="string"> instead of : <dtml-sqlvar something type='string'>
Yes, I have.... it chokes on that, too. :-( Russell On Thursday 23 August 2001 16:59, you wrote:
have you tried:
<dtml-sqlvar something type="string">
instead of :
<dtml-sqlvar something type='string'>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Thu, Aug 23, 2001 at 03:55:31PM -0500, Matt Hand wrote:
On Thu, Aug 23, 2001 at 04:30:48PM -0400, Jim Penny wrote:
With any luck this is just a "me too" message. ZPoPyDA 2.0.7 does in fact have a serious problem with strings. Fortunately the fix is extermely easy. At about line 25 of PoPy_DA.py, insert a line that says import string I put it right before the line saying from PoPy_db import DB Make sure you are editting the version in $(ZOPEHOME)/lib/products/python/ZPoPyDA Restart zope after you make this edit. This will fix the problem both in the test tab and in actual use. Jim Penny
Which PoPy, which ZPoPyDA?
For me, the answers are: PoPy 2.0.7, and ZPoPyDA 2.0.5...
I can assure you that there are no such problems prior to 2.0.5, and I really suspect that there are no such problems in 2.0.7,
I suspect that the lack of response you are getting is because it is SO outside the experience of everyone else that no-one has the least clue of what is happening to you. Yeah, I kinda figured that. No biggie, though. :-)
Russell: are you also saying that you can now connect to your database and that ZSQL methods containing references to type=string are failing?
Yes, that's exactly what I'm saying. Thanks for the help! Russell
Jim Penny
participants (6)
-
Antonio JesÚS Carrasco GarcÍA -
Jim Penny -
Matt Hand -
Russell Hires -
Steve Drees -
Tom Jenkins