Re: [Zope] dtml-if
Am Montag, den 29.08.2005, 14:08 +1000 schrieb michael: > Thanks thats it! Why is it like that? > ... > >>> > >>> On 8/28/05, michael <[EMAIL PROTECTED]> wrote: > >>> > What am I doing wrong here? > > -- this prints out the variable sent from last > (referring) page fine > -- this prints out the id of the current item fine > > > this one! > > i want this to output "this one!" when the current item is the one > requested by the last page but they are never seen as == even when the > two dtml-var are the same > > they are never equal! You will see this in the list archives several times in the past. Depending on the object, id is a method and not an simple attribute. To be on the save side (instead of figuring out what it is actually) always use: getId() Btw. does not use the id the same way like . Try and you will see the method signature (view document source in the browser) I'd recommend doing that all in a python script and then use the prepared data in your DTML - oder later ZPT. ___ Zope maillist - Zope@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 )
Re: [Zope] dtml-if
Thanks thats it! Why is it like that? m David Siedband wrote: Try calling id then comparing it. this one! -- David On Aug 28, 2005, at 7:19 PM, michael wrote: Thanks for your reply, that is half way there, I want to compare two variables though. where as 'my page' is constant, and hard coded in. someone's gotta know :-) mike Greg Fischer wrote: I have never been able to do that either and always wondered how to do it. However I have a workaround that I use frequently. I just use the title instead, which works perfectly. This one! Greg On 8/28/05, michael <[EMAIL PROTECTED]> wrote: What am I doing wrong here? -- this prints out the variable sent from last (referring) page fine -- this prints out the id of the current item fine this one! i want this to output "this one!" when the current item is the one requested by the last page but they are never seen as == even when the two dtml-var are the same they are never equal! thanks, mike ___ Zope maillist - Zope@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 )
Re: [Zope] dtml-if
Try calling id then comparing it. this one! -- David On Aug 28, 2005, at 7:19 PM, michael wrote: Thanks for your reply, that is half way there, I want to compare two variables though. where as 'my page' is constant, and hard coded in. someone's gotta know :-) mike Greg Fischer wrote: I have never been able to do that either and always wondered how to do it. However I have a workaround that I use frequently. I just use the title instead, which works perfectly. This one! Greg On 8/28/05, michael <[EMAIL PROTECTED]> wrote: What am I doing wrong here? -- this prints out the variable sent from last (referring) page fine -- this prints out the id of the current item fine this one! i want this to output "this one!" when the current item is the one requested by the last page but they are never seen as == even when the two dtml-var are the same they are never equal! thanks, mike ___ Zope maillist - Zope@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@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@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 )
Re: [Zope] dtml-if
Thanks for your reply, that is half way there, I want to compare two variables though. where as 'my page' is constant, and hard coded in. someone's gotta know :-) mike Greg Fischer wrote: I have never been able to do that either and always wondered how to do it. However I have a workaround that I use frequently. I just use the title instead, which works perfectly. This one! Greg On 8/28/05, michael <[EMAIL PROTECTED]> wrote: What am I doing wrong here? -- this prints out the variable sent from last (referring) page fine -- this prints out the id of the current item fine this one! i want this to output "this one!" when the current item is the one requested by the last page but they are never seen as == even when the two dtml-var are the same they are never equal! thanks, mike ___ Zope maillist - Zope@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@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 )
Re: [Zope] dtml-if
I have never been able to do that either and always wondered how to do it. However I have a workaround that I use frequently. I just use the title instead, which works perfectly. This one! Greg On 8/28/05, michael <[EMAIL PROTECTED]> wrote: > What am I doing wrong here? > > -- this prints out the variable sent from last > (referring) page fine > -- this prints out the id of the current item fine > > > this one! > > i want this to output "this one!" when the current item is the one > requested by the last page but they are never seen as == even when the > two dtml-var are the same > > they are never equal! > > > thanks, > mike > > > ___ > Zope maillist - Zope@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 ) > -- Greg Fischer 1st Byte Solutions http://www.1stbyte.com ___ Zope maillist - Zope@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] dtml-if
What am I doing wrong here? -- this prints out the variable sent from last (referring) page fine -- this prints out the id of the current item fine this one! i want this to output "this one!" when the current item is the one requested by the last page but they are never seen as == even when the two dtml-var are the same they are never equal! thanks, mike ___ Zope maillist - Zope@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 )
RE: [Zope] dtml-if and dtml-with problems
Thanks that did the trick... also found out that works as well. > -Original Message- > From: Andy McKay [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, November 16, 2000 12:45 PM > To: James Sintz; [EMAIL PROTECTED] > Subject: Re: [Zope] dtml-if and dtml-with problems > > If your nl_goLiveDate is a date, then you might need to str() the variable > > > -- > Andy McKay, Developer. > ActiveState. > > - Original Message - > From: "James Sintz" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, November 16, 2000 9:13 AM > Subject: [Zope] dtml-if and dtml-with problems > > > > Could someone tell me why the follow statement is never true. > > > > > > > > - > > > > > > > > > > > > > > The news folder contains several newsletters and one of them DOES have a > > 'nl_goLiveDate' of 2000/11/16 yet the above express seems to be always > > false. What obvious mistake am I making? > > > > Ideally I would like the page to show only the newsletter that has the > same > > date as today's date. > > > > Jamey > > > > ___ > > Zope maillist - [EMAIL PROTECTED] > > http://lists.zope.org/mailman/listinfo/zope > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml-if and dtml-with problems
If your nl_goLiveDate is a date, then you might need to str() the variable -- Andy McKay, Developer. ActiveState. - Original Message - From: "James Sintz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 16, 2000 9:13 AM Subject: [Zope] dtml-if and dtml-with problems > Could someone tell me why the follow statement is never true. > > > > - > > > > > > > The news folder contains several newsletters and one of them DOES have a > 'nl_goLiveDate' of 2000/11/16 yet the above express seems to be always > false. What obvious mistake am I making? > > Ideally I would like the page to show only the newsletter that has the same > date as today's date. > > Jamey > > ___ > Zope maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] dtml-if and dtml-with problems
Could someone tell me why the follow statement is never true. - The news folder contains several newsletters and one of them DOES have a 'nl_goLiveDate' of 2000/11/16 yet the above express seems to be always false. What obvious mistake am I making? Ideally I would like the page to show only the newsletter that has the same date as today's date. Jamey ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] dtml-if problem
Hi Terry - Disclaimer: I'm a Zope Newbie... Here's what I'd try: Length of the value of Area is: Length of the 'strip'ped value of Area is: If you see somethinkg like: Length of the value of Area is: 4 (or more) Length of the 'strip'ped value of Area is: 3 when you view the DTML method, you have either white space in your Area variable or a linefeed charater, or... If that's the case, here's a working if statement: You could also try: 0"> which will search for an instance of 'BIS' in the value of the Area variable Hope it helps, Eric. // -Original Message- // From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Terry // Babbey // Sent: Thursday, October 19, 2000 1:37 PM // To: [EMAIL PROTECTED] // Subject: [Zope] dtml-if problem // // // The following will not evaluate true and I am stumped again. // // // // Area is a variable I am passing to my method and I want to check to // see if the variable is set to BIS, but it never returns true even // though a displays BIS. // // Confused as always, // Terry // // -- // __ // Terry Babbey // Technical Support Specialist // Lambton College, Sarnia, Ontario, Canada // __ // // // // ___ // Zope maillist - [EMAIL PROTECTED] // http://lists.zope.org/mailman/listinfo/zope // ** No cross posts or HTML encoding! ** // (Related lists - // http://lists.zope.org/mailman/listinfo/zope-announce // http://lists.zope.org/mailman/listinfo/zope-dev ) // __ Do You Yahoo!? Yahoo! Messenger - Talk while you surf! It's FREE. http://im.yahoo.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml-if problem
Could be that you are not evaluting the string of Area try: - Original Message - From: "Terry Babbey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 19, 2000 1:37 PM Subject: [Zope] dtml-if problem > The following will not evaluate true and I am stumped again. > > > > Area is a variable I am passing to my method and I want to check to > see if the variable is set to BIS, but it never returns true even > though a displays BIS. > > Confused as always, > Terry > > -- > __ > Terry Babbey > Technical Support Specialist > Lambton College, Sarnia, Ontario, Canada > __ > > > > ___ > Zope maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] dtml-if problem
The following will not evaluate true and I am stumped again. Area is a variable I am passing to my method and I want to check to see if the variable is set to BIS, but it never returns true even though a displays BIS. Confused as always, Terry -- __ Terry Babbey Technical Support Specialist Lambton College, Sarnia, Ontario, Canada __ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml-if confusion
I believe you need the following ( the following is psuedo code): an initial dtml method that processes your form, let call it dtmlForm and it has a variable prod_req which says how much of the product is requested. In dtmlForm you of course must call some dtml method which we call dtmlVerify. In dtmlVerify you need to check: do a dtml-let xyz= "queryProduct" ... do a dtml-if "xyz <= prod_req" then ok else error. I think that's it. let me know if this helps. -Original Message- From: Kenny Flegal <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Tuesday, June 13, 2000 11:48 AM Subject: [Zope] dtml-if confusion >I have basically completed a management interface for one of our clients >using zope. I have your standard product and order management. If a customer >orders something that is out of stock I need to create a back order. > >I add an order in a query called addorder, in this I need to set up an if >statement to make sure their is enough product in stock. I have a seperate >query called onhand, this selects a product and returns instock a field >containing the number in stock of a product. I need to pull instock from >this query and subtract quantity they entered in the form and find out if >the result is greater than or equal to zero. I have the insert statement and >everything else I just can't figure out how to call instock from the onhand >query and quantity from REQUEST (I think it is still in request even though >i am in a ZSQL method) and then test if the result is greater than or equal >to 0. > >If anyone could help me with this it would be greatly appreciated. > >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com > > >___ >Zope maillist - [EMAIL PROTECTED] >http://lists.zope.org/mailman/listinfo/zope >** No cross posts or HTML encoding! ** >(Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] dtml-if confusion
I have basically completed a management interface for one of our clients using zope. I have your standard product and order management. If a customer orders something that is out of stock I need to create a back order. I add an order in a query called addorder, in this I need to set up an if statement to make sure their is enough product in stock. I have a seperate query called onhand, this selects a product and returns instock a field containing the number in stock of a product. I need to pull instock from this query and subtract quantity they entered in the form and find out if the result is greater than or equal to zero. I have the insert statement and everything else I just can't figure out how to call instock from the onhand query and quantity from REQUEST (I think it is still in request even though i am in a ZSQL method) and then test if the result is greater than or equal to 0. If anyone could help me with this it would be greatly appreciated. Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )