[Zope] Z SQL Method question

Infor Gates info_gates at yahoo.com
Sun Jun 4 00:31:52 EDT 2006


Dear Martin
 
 If you build your form with formulator, formulator add a prefix (field_variablename) to your variable. You need to use:
 <dtml-call "YourForm.validate_all_to_request(REQUEST)">  to remove the prefix (field_) before updating your database. Plesae read formulator help to see more examples.
 
 You can try using "<dtml-var REQUEST>" to see your form variables.

Good luck.

CY

Martin Koekenberg <martin at digital-adventures.nl> wrote:     .htmtableborders, .htmtableborders td,  .htmtableborders th {border : 1px dashed lightgrey ! important;}     html, body { border: 0px; }  span.macro, span.macro ul,  span.macro div, span.macro p {background : #CCCCCC;}    p{margin-bottom: 0.15em;margin-top:  0.15em;}body{font-family:tahoma;font-size:10pt;};     Hello  Thomas,
 Thanks for your response.
  
  Onthis moment my databse writing is based on DTML.
   
 The problem is that when I test this Z MySQL  Method it's working.
  
 Arguments:
  ID:int=1
voornaam:string=""
achternaam:string=""
   
 Query:
 INSERT INTO users SET
ID =  1234567894,
voornaam = 'Martin',
achternaam = 'Koekenberg'
 
Everything is writen in the database.
  
 Now  the following....
 I submit a form (build with formulator).
  The action point to a dtml Method witch calls the above Z MySQL Method  (dtml-call write_user).
  
 Nothing is  happening........
  
 I'm doing something wrong,  but what......
  
 The next step is to remove the  valuea and replace them with a <dtml-sqlvar ..........
 and  replace the <dtml-call write_user with <dtml-call  write_user(field_id,field_voornaam,field_acyternaam
  
  Can you help me withe the next step.... I't the first time that I use  MySQL/Zope and Z MySQL Method.
  
 Regards,
   
 Martin Koekenberg
 -----Original Message-----
From:  Thomas Bennett <bennetttm at appstate.edu>
To: zope at zope.org
Date:  Fri, 26 May 2006 09:16:24 -0400
Subject: Re: [Zope] Z SQL Method  question

  With a lack of information here I'll answer based fully on assumption based  on 
dtml. 

 In your form the action should go to a dtml  method.

<form action="optional_path_to/some_method" ...>

 The dtml method should have a call to your Z SQL Method

<dtml-call  my_sql_method>

And then you can add anything in the dtml method  which will be viewed as the 
response page to the user that submitted the  form.  You can also do some 
validation here if needed, with  conditional statements.   I usually add a 
redirect under the  dtml-call to go to a different response page to the user 
because if the  user reloads the page with the dtml-call it will send the data 
to the  database again unless there is a conflict like unique fields etc..

 or

Are you using ZPT?

Thomas

On Friday 26 May 2006  08:54, Martin Koekenberg wrote:
> Hello,
>
> Who has  experience with Z SQL Method.
> I Created a from to enten some data  into MySQL server. I used Z SQL Method
> to write the dat into the  databse. Everytime I submit the form I get a
> screen with the field  in my Z SQL Method component.
>
> How can I write the dat from a  form into my database at once by using Z SQL
> Method ?
> I  tested the database connetion, that is working.
>
> Regards,
 >
> Martin Koekenberg

-- 
 ====================================================================
 Thomas McMillan Grant Bennett      Appalachian State  University
Computer Consultant III          P O Box 32026
University Library             Boone, North Carolina 28608
(828) 262 6587

An  important measure of effort in coding is the frequency with which you write  
something that doesn't actually match your mental representation of the  
problem, and have to backtrack on realizing that what you just typed  won't 
actually tell the language to do what you're thinking. -Eric  Raymond

Library Systems Help Desk:  http://linux.library.appstate.edu/help
 ====================================================================
 _______________________________________________
Zope maillist  -   Zope at zope.org
 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 )

 _______________________________________________
Zope maillist  -  Zope at zope.org
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!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060603/998a6fc9/attachment.htm


More information about the Zope mailing list