[Zope-DB] SQL exception handling questions

Andrew Veitch andrew@logicalprogression.net
Mon, 17 Mar 2003 18:15:18 +0000

Sorry I was assuming you were writing a Python file system product.

Zope scripts restrict what you can import for security reasons.

The ways round this are to:
1) use an External Method
2) write a file system product

For SQL I would recommend against using External Methods because of the way
they behave with Zope's transaction machinery (essentially they are outside
it which is useful sometimes).

So I think you would have to write a file system product to do this
properly. Unless anyone has a better idea?


On 17/3/03 4:28 pm, "Luis Mariano Luporini" <lluporini@yahoo.com.ar> wrote:

> Now, I've the following script:
> # Start
> import psycopg
> try:
>   context.sql_insertar_estadistica(equipo=eq, fecha=fe,
> concepto_1=cn1, concepto_2=cn2, concepto_3=cn3, concepto_4=cn4, valor=vl)
> except psycopg.IntegrityError:
>   print "Error"
> print "Finalizado"
> return printed
> # End
> And when I tried to test it, Zope asks me for user/pass (I'm in the zmi
> with admin user logged before testing) and then gives me:
> *Error Type: Unauthorized*
> *Error Value: You are not allowed to access IntegrityError in this context*
> Do you know what it could be?