[Zope] Authentication Error on python script db submit

Wayne Connolly wayne@c-media.com.au
Tue, 17 Jun 2003 16:28:09 -0700 (PDT)


Phil,

Thanks for the reply.

It is a python script not a external method in zope.
The python script is at the domain root. 

I read here
http://images.devshed.com/Server_Side/Python/PythonMySQL/PythonMySQL.pdf
that its possible and baiscaliy repurposed it for my
own needs.

I really need this py script to connect to the mysql
db to do an UPDATE (then if the UPDATE fails) do a
INSERT.

Any idea's?

Wayne

--- In zope@yahoogroups.com, Phil Harris
<phil.harris@z...> wrote:
> Where exactly is this script? and what type is it?
> 
> If it's an external method then it isn't.
> 
> If it's a Script (Python) then MySQLdb isn't
available.
> 
> 
> 
> On Tue, 17 Jun 2003 23:14:35 +1000, Wayne Connolly
<wayne@c...> 
> wrote:
> 
> > Hi,
> >
> > I am trying to connect to a db and UPDATE or
INSERT, if the update fails, 
> > some data.
> >
> > The script saves without a error but once the
script it run the Zope 
> > Authentication window pops up. After 3 login
attempts, i know the 
> > password :-P, it produces the stupid error "Error
Type: Unauthorized
> > Error Value: You are not allowed to access connect
in this context
> > "
> > The Proxy roles are set to authenticated on the
script(i have tried 
> > manager and owner and all 3 at same time).
> >
> > The script is below.
> >
--------------------------------------------------------------------------

> >
> >
> > #!/usr/bin/python
> > # import MySQL module import MySQLdb
> > # connect db = MySQLdb.connect(host="localhost",
user="myUserName", 
> > passwd="myPassWord", db="names")
> > # create a cursor cursor = db.cursor()
> > # execute SQL statement cursor.execute("""INSERT
INTO charts (firstname, 
> > lastname)""")
------------------------------------------------------------

> >
> >
> > --------------
> >
> > Any idea's...
> >
> > Wayne
> >
> 
> 
> 
> -- 
> Phil Harris
> 
> _______________________________________________
> Zope maillist  -  Zope@z...
> 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 )

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com