Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

form-controllerPythonScript-ZSQL

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


javi80mix at gmail

Mar 7, 2007, 1:35 AM

Post #1 of 7 (1461 views)
Permalink
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[at]localhost zforum zforum'))

zsql:
how to do it????

Thanks for your help
_______________________________________________
Zope-DB mailing list
Zope-DB[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


charlie at egenix

Mar 7, 2007, 1:37 AM

Post #2 of 7 (1366 views)
Permalink
Re: form-controllerPythonScript-ZSQL [In reply to]

Am 07.03.2007, 10:35 Uhr, schrieb javi lopez <javi80mix[at]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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


maciej.wisniowski at coig

Mar 7, 2007, 1:42 AM

Post #3 of 7 (1369 views)
Permalink
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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


javi80mix at gmail

Mar 7, 2007, 1:48 AM

Post #4 of 7 (1365 views)
Permalink
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[at]egenix.com>:
> Am 07.03.2007, 10:35 Uhr, schrieb javi lopez <javi80mix[at]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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


charlie at egenix

Mar 7, 2007, 1:54 AM

Post #5 of 7 (1360 views)
Permalink
Re: form-controllerPythonScript-ZSQL [In reply to]

Am 07.03.2007, 10:48 Uhr, schrieb javi lopez <javi80mix[at]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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


javi80mix at gmail

Mar 7, 2007, 2:39 AM

Post #6 of 7 (1370 views)
Permalink
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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


charlie at egenix

Mar 7, 2007, 2:53 AM

Post #7 of 7 (1372 views)
Permalink
Re: form-controllerPythonScript-ZSQL [In reply to]

Am 07.03.2007, 11:39 Uhr, schrieb javi lopez <javi80mix[at]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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.