Mailing List Archive

form-controllerPythonScript-ZSQL
Hello everyone:
i´m doing a form where i get email and one ask. when I check that
email is valid, I do Controller Python Script where i want to create:
- DB conecction
- ZSQL method to modify DB
- get user session
and after i call a zpt, it tell me that all it´s ok

DB conection:

db_system_type = REQUEST.get('db_system_type', 'mysql')

from Products.ZMySQLDA import DA

DA.manage_addZMySQLConnection(self, db_conn_id, '',
REQUEST.get('db_conn_str', 'zforum@localhost zforum zforum'))

zsql:
how to do it????

Thanks for your help
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: form-controllerPythonScript-ZSQL [ In reply to ]
Am 07.03.2007, 10:35 Uhr, schrieb javi lopez <javi80mix@gmail.com>:

> Hello everyone:
> i´m doing a form where i get email and one ask. when I check that
> email is valid, I do Controller Python Script where i want to create:

Why do you need a DB connection per user? You can't do this in a
PythonScript. You will need to use an ExternalMethod or a Product but I
would guess you need to rethink your application.

Charlie
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: form-controllerPythonScript-ZSQL [ In reply to ]
> zsql:
> how to do it????
Have you read 'Relational database connectivity' chapter of Zope Book?

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: form-controllerPythonScript-ZSQL [ In reply to ]
All that is a little part of a Product, but i need check that´s ok ,
when I fill in the form , email and ask are stored in my DB with zsql
method, i need user to stored in DB too.
how could do it??
thanks

2007/3/7, Charlie Clark <charlie@egenix.com>:
> Am 07.03.2007, 10:35 Uhr, schrieb javi lopez <javi80mix@gmail.com>:
>
> > Hello everyone:
> > i´m doing a form where i get email and one ask. when I check that
> > email is valid, I do Controller Python Script where i want to create:
>
> Why do you need a DB connection per user? You can't do this in a
> PythonScript. You will need to use an ExternalMethod or a Product but I
> would guess you need to rethink your application.
>
> Charlie
>
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: form-controllerPythonScript-ZSQL [ In reply to ]
Am 07.03.2007, 10:48 Uhr, schrieb javi lopez <javi80mix@gmail.com>:

> All that is a little part of a Product, but i need check that´s ok ,
> when I fill in the form , email and ask are stored in my DB with zsql
> method, i need user to stored in DB too.
> how could do it??

I am sorry but I do not understand exactly what you want to do. Getting
connections on a per user basis doesn't seem to me to make a lot of sense
when using an application server like Zope. Generally you just need to get
hold of an existing connection object and ask it to do the SQL for you.

Good luck

Charlie
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: form-controllerPythonScript-ZSQL [ In reply to ]
My product is like a faq, i have a search engine, it search a
ask-answer in my portal, but if there isn´t result, i fill in a form,
it store email and ask of the user on my DB and when my admin knows
the answer, he answered to the user.
I have the product, but I don´t know how to do this part(form-store DB
with zsql method) inside my product
Any help???
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: form-controllerPythonScript-ZSQL [ In reply to ]
Am 07.03.2007, 11:39 Uhr, schrieb javi lopez <javi80mix@gmail.com>:

> My product is like a faq, i have a search engine, it search a
> ask-answer in my portal, but if there isn´t result, i fill in a form,
> it store email and ask of the user on my DB and when my admin knows
> the answer, he answered to the user.
> I have the product, but I don´t know how to do this part(form-store DB
> with zsql method) inside my product
> Any help???

from Products.ZSQLMethods.SQL import SQL

will let you handle SQL within a Product that you can then pass to your
connection object.

Charlie
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db