[Zope] ZMySQLDA Question
Hi; I want to do something like this in my Page Template: mysql select * from products order by name, newRow; Now, I know I can do this: tal:define=items python:sequence.sort(items, (('name', 'cmp', 'asc'),)) but that only orders by name, not by name *and* newRow. Any ideas? TIA, Tony Email and AIM finally together. You've gotta check out free AOL Mail! - http://mail.aol.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 )
Re: [Zope] ZMySQLDA Question
Thanks! -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Thu, 27 Sep 2007 3:43 pm Subject: Re: [Zope] ZMySQLDA Question ? --On 27. September 2007 15:37:33 -0400 [EMAIL PROTECTED] wrote:? ? Hi;? I want to do something like this in my Page Template:? mysql select * from products order by name, newRow;? ? Now, I know I can do this:? ? tal:define=items python:sequence.sort(items, (('name', 'cmp', 'asc'),))? ? but that only orders by name, not by name *and* newRow. Any ideas?? ? ? YES! You read the fine documentation:? ? http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AdvZPT.stx? ? -aj? Email and AIM finally together. You've gotta check out free AOL Mail! - http://mail.aol.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] Global Variable In PT
Hi: I have this code (editing out the extraneous) at the beginning of a page: body bgcolor=#ff tal:define=newRow string:yes After calling some other variables (specifically rotating through a changing ¨item¨ (for item in items...)), I try and change newRow: span tal:define=global newRow item/newRow tal:omit-tag= / Then I try and call newRow: p tal:replace=newRow / But it gives me the original value. Now, if I edit the page like this: span tal:define=global newRow item/newRow tal:omit-tag= p tal:replace=newRow / /span it gives me a different value (the one I expect and want). Obviously, my ¨global¨ definition isn´t going global. What can I do to make it global; that is, call it outside of the span tag? TIA, Tony Email and AIM finally together. You've gotta check out free AOL Mail! - http://mail.aol.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] How Do I Structure This?
Hi; I have the following PT code: a tal:attributes=href python:here.a_script(str(x)) and I want to structure it, kind of like this: a tal:attributes=structure href python:here.a_script(str(x)) How do I do that? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] How Do I Structure This?
Bummer. Well, I'm trying to call a script that will render content to the Web, like this: a tal:attributes=href python:here.a_script(str(x)) which calls a script that does this: return htmlbody + x + /body/html but of course it delivers this to the browser: lt;htmlgt;lt;bodygt;xlt;/bodygt;lt;/htmlgt; Any way to work around this problem? TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Wed, 15 Aug 2007 10:20 am Subject: Re: [Zope] How Do I Structure This? ? --On 15. August 2007 10:17:56 -0400 [EMAIL PROTECTED] wrote:? ? Hi;? I have the following PT code:? a tal:attributes=href python:here.a_script(str(x))? and I want to structure it, kind of like this:? a tal:attributes=structure href python:here.a_script(str(x))? How do I do that?? ? As documented, 'structure' only works with tal:content|replace.? ? -aj? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] How Do I Structure This?
I tried this: a tal:attributes=href string:${here/a_script}?doc=${x} but got this error: Error Type: TypeError Error Value: a_script() takes exactly 1 argument (0 given) Next, I rewrote the script to put in a try statement for the variable, to test that, but before I even got to test I looked at the rendered code from the above line and it gave me this: a href=lt;htmlgt;lt;bodygt;nopelt;/bodygt;lt;/htmlgt;?doc=0 So it doesn't look like the string:${... workaround worked :( And I don't think I need to URLquote. TIA, Tony -Original Message- From: Chris Withers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Wed, 15 Aug 2007 11:05 am Subject: Re: [Zope] How Do I Structure This? Ah Tony,? ? looks like the penny is yet to drop...? ? [EMAIL PROTECTED] wrote:? Bummer. Well, I'm trying to call a script that will render content to the Web, like this:? a tal:attributes=href python:here.a_script(str(x))? ? My guess is that what you're _really_ trying to do here is:? ? a href=? ?tal:attributes=href string:${here/a_script/absolute_url}?avar=${x}/? ? ...but next you'll be wondering how to url quote x.? ? I feel we're fighting a loosing battle here...? ? Chris? ? -- Simplistix - Content Management, Zope Python Consulting? ? - http://www.simplistix.co.uk? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] How Do I Structure This?
Well, I'm trying to do the following: 1) generate a list of variables using tal:define 2) pass those variables to a script, that will then make a few edits and render everything as an HTML page. I'm doing this as a work-around to the problem I posted earlier, that nobody apparently could solve, called Form-Through-Script, where I was trying to call a script using a form action but couldn't pass the page as a variable. Well, I can pass variables and reconstruct the page, but then I have the problem of missing structure. Conversely, it could pass those variables to a page that would then render, but how to pass them and render the page? There has GOT to be a way to work around this! TIA, Tony -Original Message- From: Doyon, Jean-Francois [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; zope@zope.org Sent: Wed, 15 Aug 2007 10:50 am Subject: RE: [Zope] How Do I Structure This? Why would you put HTML inside an HREF? ? Sounds to me like you want html tal:replace=structure python: here.a_script(str(x)) / or something like that. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: August 15, 2007 10:45 To: [EMAIL PROTECTED]; zope@zope.org Subject: Re: [Zope] How Do I Structure This? Bummer. Well, I'm trying to call a script that will render content to the Web, like this: a tal:attributes=href python:here.a_script(str(x)) which calls a script that does this: return htmlbody + x + /body/html but of course it delivers this to the browser: lt;htmlgt;lt;bodygt;xlt;/bodygt;lt;/htmlgt; Any way to work around this problem? TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Wed, 15 Aug 2007 10:20 am Subject: Re: [Zope] How Do I Structure This? --On 15. August 2007 10:17:56 -0400 [EMAIL PROTECTED] wrote:? ? Hi;? I have the following PT code:? a tal:attributes=href python:here.a_script(str(x))? and I want to structure it, kind of like this:? a tal:attributes=structure href python:here.a_script(str(x))? How do I do that?? ? As documented, 'structure' only works with tal:content|replace.? ? -aj? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] How Do I Structure This?
Oops...forgot the absolute_url part :-) Works fine now. Thanks! Tony -Original Message- From: Chris Withers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Wed, 15 Aug 2007 11:05 am Subject: Re: [Zope] How Do I Structure This? Ah Tony,? ? looks like the penny is yet to drop...? ? [EMAIL PROTECTED] wrote:? Bummer. Well, I'm trying to call a script that will render content to the Web, like this:? a tal:attributes=href python:here.a_script(str(x))? ? My guess is that what you're _really_ trying to do here is:? ? a href=? ?tal:attributes=href string:${here/a_script/absolute_url}?avar=${x}/? ? ...but next you'll be wondering how to url quote x.? ? I feel we're fighting a loosing battle here...? ? Chris? ? -- Simplistix - Content Management, Zope Python Consulting? ? - http://www.simplistix.co.uk? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Another Structure Problem
Hi; I can work around this one, but it's not as elegant and will waste an hour or so. Here's the problem I'd like to resolve. I have this line of code: a tal:attributes=href string:${here/renumberTheCart/absolute_url}?doc=${here/CheckOutAfterEditStuff}test/a The problem is that doc comes back with all the special characters in ASCII: a href=http://203.223.152.46:8080/lariman.com/s/renumberTheCart?doc=lt;divgt;lt;input type=quot;hiddenquot; name=quot;redirect_cmdquot; value=quot;_cartquot;gt; etc. Is there a way to work around this? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Another Structure Problem
Well, the other fellow said url_quote was well documented, but I haven't found out where :) Since you strongly imply I need url quoting, can you tell me how to url_quote this doc parameter? a tal:attributes=href string:${here/renumberTheCart/absolute_url}?doc=${here/CheckOutAfterEditStuff} Yes, it's sloppy, but I'm trying to resolve one problem at a time. Once it's working, I'll make it cleaner ;) TIA, Tony -Original Message- From: Chris Withers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Wed, 15 Aug 2007 12:54 pm Subject: Re: [Zope] Another Structure Problem [EMAIL PROTECTED] wrote:? a href=http://203.223.152.46:8080/lariman.com/s/renumberTheCart?doc=divinput type=quot;hiddenquot; name=quot;redirect_cmdquot; value=quot;_cartquot;? etc. Is there a way to work around this?? ? Of course not, you don't need url quoting, that would be silly ;-)? ? Chris? ? PS: Why on *earth* you're passing around lumps of html in parameters anyway is *totally* beyond me...? ? -- Simplistix - Content Management, Zope Python Consulting? ? - http://www.simplistix.co.uk? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] URL_Rewrite
I have this line of code: a tal:define=std modules/Products.PythonScripts.standard; url_quote nocall: std/url_quote; x python:url_quote(here/CheckOutAfterEditStuff) tal:attributes=href string:${here/renumberTheCart/absolute_url}?doc=${x}test/a but I get this error: Error Type: NameError Error Value: name 'CheckOutAfterEditStuff' is not defined So I tried this: a tal:define=std modules/Products.PythonScripts.standard; url_quote nocall: std/url_quote; x python:url_quote(here/Our_Store/CheckOutAfterEditStuff) tal:attributes=href string:${here/renumberLarimanCart/absolute_url}?doc=${x}test/a and I got the same error, although now it can't find Our_Store. Now, Our_Store is the container for this PT and CheckOutAfterEditStuff is in the same container. What am I doing wrong? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Form-Through-Script
That is *exactly* what I'm trying to do. But again, I can't send the parameter to the script, which in this case, is the entire document. Please see the other post I'm sending up right now. TIA, Tony -Original Message- From: Tom Von Lahndorff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 5:38 pm Subject: Re: [Zope] Form-Through-Script or maybe you have an update page where you remove items and then a confirm page where you can send to PP? On Aug 13, 2007, at 5:14 PM, [EMAIL PROTECTED] wrote: I'm trying to make a silk purse out of a pig's ear :) I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered 1 for all the hidden fields of the first product, 2 for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. TIA, Tony -Original Message- From: Tom Von Lahndorff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 4:59 pm Subject: Re: [Zope] Form-Through-Script can you describe what you're trying to do a little more clearly? On Aug 13, 2007, at 4:29 PM, [EMAIL PROTECTED] wrote: Well it didn't like that, either: ? Invalid request The parameter, doc, was omitted from the request. again. But look here: td tal:define=docs here/CheckOutAfterEditStuff form action=renumberTheCart(docs) method=post enctype=multipart/form-data p metal:use-macro=here/CheckOutAfterEditStuff/macros/main / See, I have a definition of docs, but it's not pointing to a use-macro widget. Must be the problem, but how do I do that? TIA, Tony -Original Message- From: Tom Von Lahndorff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script I think you want: form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post enctype=multipart/form-data td form action=http://example.com/s/renumberTheCart; method=post input type=hidden name=doc value= tal:attributes=value here/CheckOutAfterEditStuff /? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? /td (my tal may be a bit off) On Aug 13, 2007, at 4:09 PM, [EMAIL PROTECTED] wrote: No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? td tal:define=docs here/CheckOutAfterEditStuff form action=http://example.com/s/renumberTheCart?doc=docs; method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? /td TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 [EMAIL PROTECTED] wrote:? ? ? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post? ? but I need to pass a parameter doc, which, of course, is the document? I'm submitting. So I tried this:? ? form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? http://www.w3schools.com/html/html_forms.asp? ? -aj? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 ) = = =
Re: [Zope] Form-Through-Script
I don't think I've misunderstood you and I have done what I believe I understand you to say. I can't check the browser (generated)?code because I get an error stating I haven't passed the requisite variable to the script. The variable is the entire document, or at least the hidden variables. They aren't being passed to the script and I don't know how to do that. I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered 1 for all the hidden fields of the first product, 2 for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. Let me summarize what I've written before to put in one post exactly what's going on: 1)?I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so: form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post but I need to pass a parameter doc, which, of course, is the document I'm submitting. So I tried this: form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post p metal:use-macro=here/CheckOutAfterEditStuff/macros/main / which renders my page fine, but throws an error when I submit the form: Cannot locate object at: http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here 2) I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? td tal:define=docs here/CheckOutAfterEditStuff form action=http://example.com/s/renumberTheCart?doc=docs; method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? /td Now, Tom Von Lahndorff suggested the following: Sounds like the script should check to see if the user is removing something like: input type=checkbox name=remove value=item-374623746 if remove remove the item redirect back to the udpated form page else send to PP this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP. I would LOVE to do that...if I knew how! Any ideas? TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Tue, 14 Aug 2007 12:43 am Subject: Re: [Zope] Form-Through-Script ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? td tal:define=docs here/CheckOutAfterEditStuff form action=http://example.com/s/renumberTheCart?doc=docs; method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? /td Now, Tom Von Lahndorff suggested the following: Sounds like the script should check to see if the user is removing something like: input type=checkbox name=remove value=item-374623746 if remove remove the item redirect back to the udpated form page else send to PP this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP. I would LOVE to do that...if I knew how! Any ideas? TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Tue, 14 Aug 2007 12:43 am Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 17:40:35 -0400 [EMAIL PROTECTED] wrote:? ? ? I would LOVE to do that. I don't know how :( Can you point me to a good? tutorial or explain this a bit and give me some KW to chase down in? google?? ? ? Tony, please think about what you're doing for a moment.? ? If you want to call a method or a script XXX inside Zope through a form? where the method expects parameters A and B then you have to write:? ? form action=XXX method=get|post? ? input type=hidden name=A tal:attributes=value context/some_method_providing_a /? input type=hidden name=B tal:attributes=value context/some_method_providing_b /? ? Now apply this knowledge to your usecase. Check your _generated_? code twice if all requirements are fulfilled.? ? -aj? ? AOL now offers free email to everyone.
[Zope] What If It Doesn't Have a Key?
Hi; I have this line of code: span tal:condition=python:request.has_key('checkbox_1') tal:omit-tag= I would like to do the exact opposite of that. In other words, have the condition render if checkbox_1 does not exist. How do I do that? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] What If It Doesn't Have a Key?
Oh ;) Thanks. Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 12:47 pm Subject: Re: [Zope] What If It Doesn't Have a Key? ? --On 13. August 2007 12:36:13 -0400 [EMAIL PROTECTED] wrote:? ? Hi;? I have this line of code:? span tal:condition=python:request.has_key('checkbox_1')? tal:omit-tag= I would like to do the exact opposite of that. In other? words, have the condition render if checkbox_1 does not exist. How do I? do that? TIA,? Tony? ? ? Look at the 'not:' directive.? ? -aj? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Form-Through-Script
Hi; I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so: form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post but I need to pass a parameter doc, which, of course, is the document I'm submitting. So I tried this: form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post p metal:use-macro=here/CheckOutAfterEditStuff/macros/main / which renders my page fine, but throws an error when I submit the form: Cannot locate object at: http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here What do I do? Also, where do I return the document? Can I re.sub the form action in my script to send it to a new place? Does it just refresh the original doc? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Form-Through-Script
No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? td tal:define=docs here/CheckOutAfterEditStuff form action=http://example.com/s/renumberTheCart?doc=docs; method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? /td TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 [EMAIL PROTECTED] wrote:? ? ? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post? ? but I need to pass a parameter doc, which, of course, is the document? I'm submitting. So I tried this:? ? form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? http://www.w3schools.com/html/html_forms.asp? ? -aj? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Form-Through-Script
multipart/form-data The content-type, right? That threw this error: Compilation failed xml.parsers.expat.ExpatError: unbound prefix: line 1, column 0 TIA, Tony -Original Message- From: Tom Von Lahndorff [EMAIL PROTECTED] To: Andreas Jung [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 13 Aug 2007 4:15 pm Subject: Re: [Zope] Form-Through-Script On Aug 13, 2007, at 3:55 PM, Andreas Jung wrote:? ? ? ? --On 13. August 2007 15:39:40 -0400 [EMAIL PROTECTED] wrote:? ? ? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post? ? but I need to pass a parameter doc, which, of course, is the document? I'm submitting. So I tried this:? ? form action=renumberTheCart(here/CheckOutAfterEditStuff) method=post? p metal:use-macro=here/CheckOutAfterEditStuff/macros/main /? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? http://www.w3schools.com/html/html_forms.asp? ? ? If you're uploading a file you'll want to also add enctype=multipart/form-data to the form tag. I usually add it by default.? ? http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4? The content type application/x-www-form-urlencoded is inefficient for sending large quantities of binary data or text containing non-ASCII characters. The content type multipart/form-data should be used for submitting forms that contain files, non-ASCII data, and binary data.? ? ? -aj? ___? Zope maillist - [EMAIL PROTECTED] 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 )? ? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Sorting Not Sorting
Hi; I have this code: table cellpadding=0 width=75% border=0 ?? tal:define=category python:getattr(request, 'category', ''); ?? items python:here.EMarket.marketItems.getItemsInCategory(category); ?? sort_on python:(('name', 'cmp', 'desc'),); ?? items python:sequence.sort(items, sort_on); ?? start python:getattr(request, 'start', 0); ?? batch python:modules['ZTUtils'].Batch(items, size=6*here.EMarket.in_row, start=start); ?? previous python:batch.previous; ?? next python:batch.next ? tr ??? td align=center class=text ? a tal:condition=previous tal:attributes=href string:${request/URL0}?category=${category}start:int=${previous/first}lt;lt;Previous/anbsp;nbsp;nbsp;a tal:condition=next tal:attributes=href string:${request/URL0}?category=${category}start:int=${next/first}Nextgt;gt;/a ??? /td ? /tr ? tr ??? td align=center ??? ? div tal:condition=batch tal:omit-tag= ? ??? div tal:condition=python:here.EMarket.in_row == 1 tal:omit-tag= ? span tal:repeat=item batch tal:omit-tag= ??? span metal:use-macro=here/AddToCart_frame_content/macros/marketitem_one/ It sorts the products by name correctly when I display the products (as you can see at http://lariman.com and click Store then cabuchones), but if you click on one of the products, it shows a different product than the one you clicked! Now, this code works fine without the sort_on part, so I suspect the problem is in the batching and the item batch, which for some reason isn't sorting as I specify. Suggestions? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Increment In PT?
Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code: div metal:define-macro=main tal:define=x python:0 tal:block tal:define=x python:x + 1 td input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` Now, all of that works...once. That is, it increments from 0 to 1, but not from 1 to 2! Each time I pass through the td element, I need it to increment. I tried putting the tal definition in the td, but then it didn´t even increment once! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Increment In PT?
In order to interact with the paypal shopping cart system, they want me to increment hidden fields, such as: input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` input type=hidden tal:attributes=value item/id; name python:'item_number_' + `x` where x is a number from 1 on up, where 1 represents the first product in the shopping cart, 2 represents the second product, etc. So...we have to do it their way. Perhaps this is really bad ZPT, but we have to do it their way. Can ZPT handle this, or not? TIA, Tony -Original Message- From: Andreas Jung [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 30 Jul 2007 10:23 am Subject: Re: [Zope] Increment In PT? --On 30. Juli 2007 10:16:35 -0400 [EMAIL PROTECTED] wrote: Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code: div metal:define-macro=main tal:define=x python:0 Why do you need a counter in ZPT? This is absolutely one of the worst things you can go in ZPT. Describe your concrete use-case and we might think about a suitable and clean solution. But thinking about counters in ZPT is a waste of life-time. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Increment In PT?
Can you give me an example of how to use the enumerate method in a repeat? I've googled this with no luck. Here's my tal:repeat clause: ? span tal:repeat=bitem_id bitem_ids; tal:omit-tag= As fas as passing this to a python script, I'd rather not. That seems like too much trouble for something that IMHO should be easy, and if it's not, perhaps the gods of PT would like to do something about it. TIA, Tony -Original Message- From: Andrew Milton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 30 Jul 2007 12:30 pm Subject: Re: [Zope] Increment In PT? +---[ [EMAIL PROTECTED] ]-- | In order to interact with the paypal shopping cart system, they want me to | increment hidden fields, such as: | | input type=hidden tal:attributes=value item/name; name python:'item_name_' | + `x` | input type=hidden tal:attributes=value item/id; name python:'item_number_' | + `x` | | where x is a number from 1 on up, where 1 represents the first product in | the shopping cart, 2 represents the second product, etc. So...we have to do | it their way. Perhaps this is really bad ZPT, but we have to do it their way. | Can ZPT handle this, or not? 1) Why not use the enumerate method in your repeat? 2) Why not pass the items to a python script that builds the structure you need and returns it? -- Andrew Milton [EMAIL PROTECTED] AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Increment In PT?
I would think this should be pretty easy in the PT itself, given what you've shared so far. But I'm still not quite there. Here's what I've got: span tal:repeat=bitem_id bitem_ids tal:omit-tag= div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=x iter/next tal:replace=iter/number / Now, I don't really want that br / tag there, because it's printing a number to screen that I don't want there. However, it only prints the number 1 twice, once for each product, when it should print 1 then 2, I would think. (I presume I should just take the tal:replace out and leave the definition, but it's still not incrementing!) Later in the script I have this: input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` input type=hidden tal:attributes=value item/id; name python:'item_number_' + `x` and other similar lines. What I'm trying to effectuate is that the x gets replaced with an incremented number. Can you help just a little more? TIA, Tony -Original Message- From: Peter Bengtsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Mon, 30 Jul 2007 1:32 pm Subject: Re: [Zope] Increment In PT? You can use the ZTUtils Iterator() div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / /div Which might give you some freedom such as iter/Roman or iter/odd The above is practically the same as: br tal:repeat=i python:range(3) tal:replace=i / Generally, if you can, use a Python Script or something. The Iterator is/was used in Plone templates to increment the tab index. [EMAIL PROTECTED] wrote: Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code: div metal:define-macro=main tal:define=x python:0 tal:block tal:define=x python:x + 1 td input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` Now, all of that works...once. That is, it increments from 0 to 1, but not from 1 to 2! Each time I pass through the td element, I need it to increment. I tried putting the tal definition in the td, but then it didn´t even increment once! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437. ___ Zope maillist - [EMAIL PROTECTED] 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 ) -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Increment In PT?
Okay, I've got this line: div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)); x iter/next and then use this kind of line several times further down and within the div: input type=hidden tal:attributes=value bitem/quantity; name python:'quantity_' + `x` What this yields is lines like this: input type=hidden name=item_name_1 value=17x25 but it never increments! And I have 3 items! How do I get it to increment? TIA, Tony -Original Message- From: Peter Bengtsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Mon, 30 Jul 2007 1:52 pm Subject: Re: [Zope] Increment In PT? You should now have all the parts. Instead of iterating over python:range(1000) do it on bitem_ids instead. You don't have to use a br / tag. You can use input tal:attributes=value iter/number / if you want. You increment it by calling tal:iter/next whichever way you do it. [EMAIL PROTECTED] wrote: I would think this should be pretty easy in the PT itself, given what you've shared so far. But I'm still not quite there. Here's what I've got: span tal:repeat=bitem_id bitem_ids tal:omit-tag= div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=x iter/next tal:replace=iter/number / Now, I don't really want that br / tag there, because it's printing a number to screen that I don't want there. However, it only prints the number 1 twice, once for each product, when it should print 1 then 2, I would think. (I presume I should just take the tal:replace out and leave the definition, but it's still not incrementing!) Later in the script I have this: input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` input type=hidden tal:attributes=value item/id; name python:'item_number_' + `x` and other similar lines. What I'm trying to effectuate is that the x gets replaced with an incremented number. Can you help just a little more? TIA, Tony -Original Message- From: Peter Bengtsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Mon, 30 Jul 2007 1:32 pm Subject: Re: [Zope] Increment In PT? You can use the ZTUtils Iterator() div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / /div Which might give you some freedom such as iter/Roman or iter/odd The above is practically the same as: br tal:repeat=i python:range(3) tal:replace=i / Generally, if you can, use a Python Script or something. The Iterator is/was used in Plone templates to increment the tab index. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code:div metal:define-macro=main tal:define=x python:0tal:block tal:define=x python:x + 1 td input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` Now, all of that works...once. That is, it increments from 0 to 1, but not from 1 to 2! Each time I pass through the td element, I need it to increment. I tried putting the tal definition in the td, but then it didn´t even increment once! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437 http://www.aol.com/?ncid=AOLAOF0002000437. ___ Zope maillist - Zope@zope.org mailto: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 ) -- Peter Bengtsson, work www.fry-it.com http://www.fry-it.com/ home www.peterbe.com http://www.peterbe.com/ hobby www.issuetrackerproduct.com http://www.issuetrackerproduct.com/ AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437. -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related
Re: [Zope] Increment In PT?
It's complaining that: Error Type: TypeError Error Value: string indices must be integers I tried back ticks and that still gave the same error. TIA, Tony tal:loop repeat=item bitems input type=hidden tal:attributes=value item/name; name string:item_name_${repeat/item/number} input type=hidden tal:attributes=value item/id; name string:item_number_${repeat/item/number} /tal:loop -Original Message- From: José Henrique [EMAIL PROTECTED] To: zope@zope.org Sent: Mon, 30 Jul 2007 2:07 pm Subject: Re: [Zope] Increment In PT? Try this way: tal:loop repeat=item bitems input type=hidden tal:attributes=value item/name; name string:item_name_${repeat/item/number} input type=hidden tal:attributes=value item/id; name string:item_number_${repeat/item/number} /tal:loop Zenrique. 2007/7/30, Peter Bengtsson [EMAIL PROTECTED]: You should now have all the parts. Instead of iterating over python:range(1000) do it on bitem_ids instead. You don't have to use a br / tag. You can use input tal:attributes=value iter/number / if you want. You increment it by calling tal:iter/next whichever way you do it. [EMAIL PROTECTED] wrote: I would think this should be pretty easy in the PT itself, given what you've shared so far. But I'm still not quite there. Here's what I've got: span tal:repeat=bitem_id bitem_ids tal:omit-tag= div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=x iter/next tal:replace=iter/number / Now, I don't really want that br / tag there, because it's printing a number to screen that I don't want there. However, it only prints the number 1 twice, once for each product, when it should print 1 then 2, I would think. (I presume I should just take the tal:replace out and leave the definition, but it's still not incrementing!) Later in the script I have this: input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` input type=hidden tal:attributes=value item/id; name python:'item_number_' + `x` and other similar lines. What I'm trying to effectuate is that the x gets replaced with an incremented number. Can you help just a little more? TIA, Tony -Original Message- From: Peter Bengtsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Mon, 30 Jul 2007 1:32 pm Subject: Re: [Zope] Increment In PT? You can use the ZTUtils Iterator() div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / /div Which might give you some freedom such as iter/Roman or iter/odd The above is practically the same as: br tal:repeat=i python:range(3) tal:replace=i / Generally, if you can, use a Python Script or something. The Iterator is/was used in Plone templates to increment the tab index. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code: div metal:define-macro=main tal:define=x python:0 tal:block tal:define=x python:x + 1 td input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` Now, all of that works...once. That is, it increments from 0 to 1, but not from 1 to 2! Each time I pass through the td element, I need it to increment. I tried putting the tal definition in the td, but then it didn´t even increment once! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437 http://www.aol.com/?ncid=AOLAOF0002000437. ___ Zope maillist - Zope@zope.org mailto: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 ) -- Peter Bengtsson, work www.fry-it.com http://www.fry-it.com/ home www.peterbe.com http://www.peterbe.com/ hobby www.issuetrackerproduct.com http://www.issuetrackerproduct.com/ AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437 . -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com ___ Zope [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
Re: [Zope] Increment In PT?
This is the code that I have: span tal:repeat=bitem_id bitem_ids tal:omit-tag= span tal:define=bitem python:here.basketItemManager.getItem(bitem_id); item python:here.marketItems.getItem(bitem.marketItemId) tal:omit-tag= This is the code that I would like to write: span tal:repeat=bitem_id bitem_ids tal:omit-tag= for each new bitem_id increment x span tal:define=bitem python:here.basketItemManager.getItem(bitem_id); item python:here.marketItems.getItem(bitem.marketItemId) tal:omit-tag= How can I do that? TIA, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 30 Jul 2007 2:30 pm Subject: Re: [Zope] Increment In PT? It's complaining that: Error Type: TypeError Error Value: string indices must be integers I tried back ticks and that still gave the same error. TIA, Tony tal:loop repeat=item bitems input type=hidden tal:attributes=value item/name; name string:item_name_${repeat/item/number} input type=hidden tal:attributes=value item/id; name string:item_number_${repeat/item/number} /tal:loop -Original Message- From: José Henrique [EMAIL PROTECTED] To: zope@zope.org Sent: Mon, 30 Jul 2007 2:07 pm Subject: Re: [Zope] Increment In PT? Try this way: tal:loop repeat=item bitems input type=hidden tal:attributes=value item/name; name string:item_name_${repeat/item/number} input type=hidden tal:attributes=value item/id; name string:item_number_${repeat/item/number} /tal:loop Zenrique. 2007/7/30, Peter Bengtsson [EMAIL PROTECTED]: You should now have all the parts. Instead of iterating over python:range(1000) do it on bitem_ids instead. You don't have to use a br / tag. You can use input tal:attributes=value iter/number / if you want. You increment it by calling tal:iter/next whichever way you do it. [EMAIL PROTECTED] wrote: I would think this should be pretty easy in the PT itself, given what you've shared so far. But I'm still not quite there. Here's what I've got: span tal:repeat=bitem_id bitem_ids tal:omit-tag= div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=x iter/next tal:replace=iter/number / Now, I don't really want that br / tag there, because it's printing a number to screen that I don't want there. However, it only prints the number 1 twice, once for each product, when it should print 1 then 2, I would think. (I presume I should just take the tal:replace out and leave the definition, but it's still not incrementing!) Later in the script I have this: input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` input type=hidden tal:attributes=value item/id; name python:'item_number_' + `x` and other similar lines. What I'm trying to effectuate is that the x gets replaced with an incremented number. Can you help just a little more? TIA, Tony -Original Message- From: Peter Bengtsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Mon, 30 Jul 2007 1:32 pm Subject: Re: [Zope] Increment In PT? You can use the ZTUtils Iterator() div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / /div Which might give you some freedom such as iter/Roman or iter/odd The above is practically the same as: br tal:repeat=i python:range(3) tal:replace=i / Generally, if you can, use a Python Script or something. The Iterator is/was used in Plone templates to increment the tab index. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code: div metal:define-macro=main tal:define=x python:0 tal:block tal:define=x python:x + 1 td input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` Now, all of that works...once. That is, it increments from 0 to 1, but not from 1 to 2! Each time I pass through the td element, I need it to increment. I tried putting the tal definition in the td, but then it didn´t even increment once! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437 http://www.aol.com/?ncid=AOLAOF0002000437. ___ Zope maillist - Zope@zope.org mailto:Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related
Re: [Zope] Increment In PT?
Well, there I go making mountains out of molehills again. This worked just fine: span tal:define=bitem python:here.basketItemManager.getItem(bitem_id); item python:here.marketItems.getItem(bitem.marketItemId); x repeat/bitem_id/number tal:omit-tag= Thanks for all, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 30 Jul 2007 2:30 pm Subject: Re: [Zope] Increment In PT? It's complaining that: Error Type: TypeError Error Value: string indices must be integers I tried back ticks and that still gave the same error. TIA, Tony tal:loop repeat=item bitems input type=hidden tal:attributes=value item/name; name string:item_name_${repeat/item/number} input type=hidden tal:attributes=value item/id; name string:item_number_${repeat/item/number} /tal:loop -Original Message- From: José Henrique [EMAIL PROTECTED] To: zope@zope.org Sent: Mon, 30 Jul 2007 2:07 pm Subject: Re: [Zope] Increment In PT? Try this way: tal:loop repeat=item bitems input type=hidden tal:attributes=value item/name; name string:item_name_${repeat/item/number} input type=hidden tal:attributes=value item/id; name string:item_number_${repeat/item/number} /tal:loop Zenrique. 2007/7/30, Peter Bengtsson [EMAIL PROTECTED]: You should now have all the parts. Instead of iterating over python:range(1000) do it on bitem_ids instead. You don't have to use a br / tag. You can use input tal:attributes=value iter/number / if you want. You increment it by calling tal:iter/next whichever way you do it. [EMAIL PROTECTED] wrote: I would think this should be pretty easy in the PT itself, given what you've shared so far. But I'm still not quite there. Here's what I've got: span tal:repeat=bitem_id bitem_ids tal:omit-tag= div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=x iter/next tal:replace=iter/number / Now, I don't really want that br / tag there, because it's printing a number to screen that I don't want there. However, it only prints the number 1 twice, once for each product, when it should print 1 then 2, I would think. (I presume I should just take the tal:replace out and leave the definition, but it's still not incrementing!) Later in the script I have this: input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` input type=hidden tal:attributes=value item/id; name python:'item_number_' + `x` and other similar lines. What I'm trying to effectuate is that the x gets replaced with an incremented number. Can you help just a little more? TIA, Tony -Original Message- From: Peter Bengtsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Mon, 30 Jul 2007 1:32 pm Subject: Re: [Zope] Increment In PT? You can use the ZTUtils Iterator() div tal:define=iter python:modules['ZTUtils'].Iterator(range(1000)) br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / br tal:define=dummy iter/next tal:replace=iter/number / /div Which might give you some freedom such as iter/Roman or iter/odd The above is practically the same as: br tal:repeat=i python:range(3) tal:replace=i / Generally, if you can, use a Python Script or something. The Iterator is/was used in Plone templates to increment the tab index. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi; I´m trying to increment a variable in a page template. Here´s the general idea in my code: div metal:define-macro=main tal:define=x python:0 tal:block tal:define=x python:x + 1 td input type=hidden tal:attributes=value item/name; name python:'item_name_' + `x` Now, all of that works...once. That is, it increments from 0 to 1, but not from 1 to 2! Each time I pass through the td element, I need it to increment. I tried putting the tal definition in the td, but then it didn´t even increment once! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at *AOL.com* http://www.aol.com?ncid=AOLAOF0002000437 http://www.aol.com/?ncid=AOLAOF0002000437. ___ Zope maillist - Zope@zope.org mailto: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 ) -- Peter Bengtsson, work www.fry-it.com http://www.fry-it.com/ home www.peterbe.com http://www.peterbe.com/ hobby www.issuetrackerproduct.com http://www.issuetrackerproduct.com/
Re: [Zope] AttributeError: Can't Pin It Down!
-Original Message- From: Dieter Maurer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Sun, 22 Jul 2007 1:51 pm Subject: Re: [Zope] AttributeError: Can't Pin It Down! [EMAIL PROTECTED] wrote at 2007-7-21 14:27 -0400: ... Error Type: AttributeError Error Value: masterMarketItems This error shows on a page but not in the error log!! Maybe, it comes from your error page (i.e. standard_error_message). Then, you should see the entry in the error log that caused the error in the first place. Nothing in the error log about that :( ... Module Products.PageTemplates.TALES, line 221, in evaluate URL: /example.com/eng/test Line 7, Column 0 Expression: PythonExpr request.contact_us_form.header() ... Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: request.contact_us_form.header() Module Python expression request.contact_us_form.header(), line 1, in expression Module ZPublisher.HTTPRequest, line 1223, in __getattr__ You did it almost right. You forgot to include the Error Type and Error Value information. Exception Type AttributeError Exception Value header But, from what you have included, I guess that request does not have a contact_us_form attribute. Can you explain? I have a Formulator form called contact_us_form and it's in the same folder, so there's no problem with inheritance. I am unfamiliar with Formulator -- but it seems strange to me that you expect request to contain complete forms. Well, frankly, I built this site a long time ago before PTs were in vogue and it worked just fine using DTML. I changed it to PT for you to throw and capture this error ;) Since this is happening with all applications and they worked just fine before I took the *zexp snapshots and loaded them into the new server, I was thinking this must come from something below the application level; namely, from a built of Zope itself. I thought maybe I built this from a FBSD port, but no, it's Z 2.7.8 and I built it from source thus: tar zxvf Zope-2.7.8-final.tgz cd Zope-2.7.8-final ./configure --with-python=/usr/local/bin/python2.3 --prefix=/usr/local/zope/278 make make install /usr/local/zope/278/bin/mkzopeinstance.py Directory: /usr/local/zope/instance1 cd /usr/local/zope/instance1 vi etc/zope.conf effective-user tony chown tony var/ chown tony etc/ chown tony etc/* chown tony log/ chown tony log/* This is fine, though, right? Also, I went to zope to find a copy of this tarball and couldn't! Every other tarball is on the list but 2.7.8!! http://www.zope.org/Products/Zope/swpackage_releases What's up with that?? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] HELP! Will PAY YOU to Fix This Problem!
Hi; I just built out a new server according to a formulary I´ve worked before without any problems. Now, however, I have a bug in ALL of my Zope sites that throws a strange attribute error for various attributes that have always worked in the past (see thread AttributeError: Can´t Pin It Down!). I built everything from *.zexp files when my sites were working fine on my old server. I can send you the exact formulary I used to build the server (on FBSD). I have lost a couple of weeks over this silly problem that no one on the list has been able to address. HELP! Write me off list. Give me your hourly rate. Thanks, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] AttributeError: Can't Pin It Down!
Okay, I can give you an example from a PT. It will follow. However... 1) All of these sites were working just fine when I made backups of them, which backups I installed on my new server I built. 2) I didn't edit anything. I just built and un-zexp'd (imported) everything. So...wouldn't it seem reasonable to conclude that there is a problem OTHER than the ones I'm posting which is causing SEVERAL AttributeErrors to be thrown from completely different sites? I would have to say it coudn't possibly be otherwise, myself. Everything else in Zope seems to be working fine. Built on FBSD 5.5 with Z 2.7.8 on Py 2.3.5 Below follows error info concerning another site with PT and a shop that says throws an AttributeError concerning masterMarketItems. But, not only does that attr. exist, but I can surf to the shopkeeper's side of things and see the products, utilizing that very attr! Error Type: AttributeError Error Value: masterMarketItems This error shows on a page but not in the error log!! Below follows that which you requested, which I hope I have done correctly. I built the page only to throw the error. Again, contact_us_form does exist as a Formmailer object, and it lives in the very same folder. TIA, Tony Module ZPublisher.Publish, line 175, in publish_module_standard Module Products.PlacelessTranslationService.PatchStringIO, line 34, in new_publish Module ZPublisher.Publish, line 132, in publish Module Zope.App.startup, line 204, in zpublisher_exception_hook Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec Module Products.PageTemplates.PageTemplate, line 96, in pt_render ZopePageTemplate at /example.com/eng/test Module TAL.TALInterpreter, line 190, in __call__ Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 460, in do_setLocal_tal Module Products.PageTemplates.TALES, line 221, in evaluate URL: /example.com/eng/test Line 7, Column 0 Expression: PythonExpr request.contact_us_form.header() Names: {'container': Folder instance at e967c50, 'context': Folder instance at e967c50, 'default': Products.PageTemplates.TALES.Default instance at 0x89fbdac, 'here': Folder instance at e967c50, 'loop': SafeMapping instance at ac0f0f0, 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x8a07d6c, 'nothing': None, 'options': {'args': ()}, 'repeat': SafeMapping instance at ac0f0f0, 'request': HTTPRequest, URL=http://203.223.152.46:8080/example.com/eng/test, 'root': Application instance at e86af50, 'template': ZopePageTemplate at /example.com/eng/test, 'traverse_subpath': [], 'user': beno} Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ __traceback_info__: request.contact_us_form.header() Module Python expression request.contact_us_form.header(), line 1, in expression Module ZPublisher.HTTPRequest, line 1223, in __getattr__ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Problem w/ ZMySQLDA
- Original Message - From: tonylabarbara at aol.com To: zope at zope.org Sent: Saturday, July 14, 2007 5:43 PM Subject: [Zope] Problem w/ ZMySQLDA Hi; ? I just built out a new server and transfered my databases. I use Zope to server my web sites and ZMySQLDA to interface between the two. Everything seems to be fine. I can see the databases, the tables, the columns in the tables, the permissions are correct, etc. I hook up ZMySQLDA and that seems to be fine. It connects to the database. However, when I go to look at the pages from served the database, the browser hangs. Any ideas how to troubleshoot this? You should have a MySQL_database_connection object in a folder somewhere (in the ZMI).? The Status for this object should say The database connection is open.? There is a Test tab for this object in which you can enter an sql query. If this query works ok, then the next step is to test your Z SQL Method(s). Thanks. That clarified a lot. The MySQL query comes back fine. I'm troubleshooting a complex shop I had a programmer who worked for me build...so it's not my code...and it's complex ;) I went into the shopkeeper's side and was able to successfully query the database. I was, for example, able to display the cotton products for editing. However, when I do essentially_the_same_thing TTW with the following code snippet, it hangs! tal:block metal:define-macro=content ?? define=dummy python:request.set('category', 5) ? tal:block metal:use-macro=here/Store/Main_frame_content/macros/content / /tal:block Furthermore, mytop shows the user is hanging: 30 mysqluser?? localhost mrtableclo?? 473? Sleep What should I do next to troubleshoot this? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Problem w/ ZMySQLDA
Forgive my ignorance, but not quite sure how to do that. Nonetheless... 1) There was no problem with any of this on the old server until the server crashed. 2) My backups were?taken from a time when the old server was was working fine. 3) This problem occurs with *all* my shopping carts, not just this one. Consequently, I have a hard time believing this is a code error. There *must* be something more fundamental at play here. I had some problems with the python-eggs, but I don't imagine that's it, since the connection works, I can query the database, etc. TIA, Tony -Original Message- From: Jonathan [EMAIL PROTECTED] To: zope@zope.org; [EMAIL PROTECTED] Sent: Mon, 16 Jul 2007 9:12 am Subject: Re: [Zope] Problem w/ ZMySQLDA - Original Message - From: [EMAIL PROTECTED]? To: zope@zope.org? Sent: Monday, July 16, 2007 8:55 AM? Subject: [Zope] Problem w/ ZMySQLDA? ? ? - Original Message - From: tonylabarbara at aol.com? To: zope at zope.org? Sent: Saturday, July 14, 2007 5:43 PM? Subject: [Zope] Problem w/ ZMySQLDA? ? ? Hi;? ? I just built out a new server and transfered my databases. I use Zope to? server my web sites and ZMySQLDA to interface between the two. Everything? seems? to be fine. I can see the databases, the tables, the columns in the? tables, the? permissions are correct, etc. I hook up ZMySQLDA and that seems to be? fine. It? connects to the database. However, when I go to look at the pages from? served? the database, the browser hangs. Any ideas how to troubleshoot this?? ? You should have a MySQL_database_connection object in a folder somewhere (in? the ZMI).? The Status for this object should say The database connection? is open.? There is a Test tab for this object in which you can enter an? sql query. If this query works ok, then the next step is to test your Z SQL? Method(s).? ? Thanks. That clarified a lot. The MySQL query comes back fine. I'm troubleshooting a complex shop I had a programmer who worked for me build...so it's not my code...and it's complex ;) I went into the shopkeeper's side and was able to successfully query the database. I was, for example, able to display the cotton products for editing. However, when I do essentially_the_same_thing TTW with the following code snippet, it hangs!? ? tal:block metal:define-macro=content? ?? define=dummy python:request.set('category', 5)? ? ? tal:block metal:use-macro=here/Store/Main_frame_content/macros/content /? ? /tal:block? ? Furthermore, mytop shows the user is hanging:? 30 mysqluser?? localhost mrtableclo?? 473? Sleep? ? What should I do next to troubleshoot this?? ? I would test the code outside of tal. Just execute (test) the routine by itself to see what it is returning. A couple of things to check: (i) is the routine receiving the correct input parameters, (ii) is the routine returning what you are expecting.? ? Jonathan ? AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Cannot Import Base has_attr...Again!
You might not believe this, but sometimes software goes haywire. Before you jump down my throat, realize that unavoidable accidents sometimes do happen. And this is the only time it's happened with me on this list, thank you very much. Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sat, 17 Mar 2007 5:12 PM Subject: Re: [Zope] Cannot Import Base has_attr...Again! Would you please be so kind AND STOP FLOODING THE LIST with posting the same issue THREE TIMES WITHIN SOME MINUTES? If you want help then consider accepting the common rules for using a mailing list and don't behave like an idiot. Read this: http://opensource.zopyx.com/helpcenter/misc/writing-smart-and-reasonable-postings-or-how-to-use-a-mailinglist/ -aj --On 17. März 2007 15:16:31 -0400 [EMAIL PROTECTED] wrote: Hi; I had this problem on another server I recently built...and it went away all by itself! I'm now rebuilding my home server, and it's cropped up again. Last time, Maciej Wisniowski suggested I go to a zopectl prompt and type in import Products.CMFPlone, but apparently that doesn't work on Zope 2.7.8/Plone 2.1.4. Here is the traceback. Please advise. TIA, Tony 2007-03-17T14:51:12 ERROR(200) Zope Could not import Products.ATContentTypes Traceback (most recent call last): File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. -- ZOPYX Ltd. Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK E-Publishing, Python, Zope Plone development, Consulting AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Cannot Import Base has_attr...Again!
I did that last time and no one addressed the issue, so I came here. Would you care to address the issue? Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Sat, 17 Mar 2007 3:21 PM Subject: Re: [Zope] Cannot Import Base has_attr...Again! --On 17. März 2007 15:16:31 -0400 [EMAIL PROTECTED] wrote: Hi; I had this problem on another server I recently built...and it went away all by itself! I'm now rebuilding my home server, and it's cropped up again. Last time, Maciej Wisniowski suggested I go to a zopectl prompt and type in import Products.CMFPlone, but apparently that doesn't work on Zope 2.7.8/Plone 2.1.4. Here is the traceback. Please advise. TIA, Tony Consult the plone-users list for Plone-related questions. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Cannot Import Base has_attr...Again!
Hi; I had this problem on another server I recently built...and it went away all by itself! I'm now rebuilding my home server, and it's cropped up again. Last time, Maciej Wisniowski suggested I go to a zopectl prompt and type in import Products.CMFPlone, but apparently that doesn't work on Zope 2.7.8/Plone 2.1.4. Here is the traceback. Please advise. TIA, Tony 2007-03-17T14:51:12 ERROR(200) Zope Could not import Products.ATContentTypes Traceback (most recent call last): File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Cannot Import Base has_attr...Again!
Hi; I had this problem on another server I recently built...and it went away all by itself! I'm now rebuilding my home server, and it's cropped up again. Last time, Maciej Wisniowski suggested I go to a zopectl prompt and type in import Products.CMFPlone, but apparently that doesn't work on Zope 2.7.8/Plone 2.1.4. Here is the traceback. Please advise. TIA, Tony 2007-03-17T14:51:12 ERROR(200) Zope Could not import Products.ATContentTypes Traceback (most recent call last): File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Cannot Import Base has_attr...Again!
Hi; I had this problem on another server I recently built...and it went away all by itself! I'm now rebuilding my home server, and it's cropped up again. Last time, Maciej Wisniowski suggested I go to a zopectl prompt and type in import Products.CMFPlone, but apparently that doesn't work on Zope 2.7.8/Plone 2.1.4. Here is the traceback. Please advise. TIA, Tony 2007-03-17T14:51:12 ERROR(200) Zope Could not import Products.ATContentTypes Traceback (most recent call last): File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] 'int' object has no attribute 'objectValues'
When I rewrite the command to tal:replace batch and surf to it, it displays the object values of every object in the quotes folder. That's what inspired me to measure the len. So, batch is not a number, but num is, and I've proven this by having the scriptlet print out that number. AJ says I shouldn't call all those objectValues into memory. Okay, what's a way around that? I just need the number ;) TIA, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: zope@zope.org Sent: Tue, 13 Mar 2007 1:50 AM Subject: Re: [Zope] 'int' object has no attribute 'objectValues' --On 12. März 2007 23:25:59 +0100 Maciej Wisniowski [EMAIL PROTECTED] wrote: span tal:define=batch here/quotes/objectValues; num python:len(batch) p tal:replace=python:here.randomNumber(num) / /span Check what here/quotes is evaluating to. Seems that it is int. In addition there is no need to call objectValues just to determine the number of all objects within a container. objectValues() will load *all objects* of the folder *into memory*. Don't do that. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Data.fs MySQL DB Blown Up!
Hi; Forgive the long (but necessary) background. I bought a new 500 GB hard drive for my server located on the other side of the world. I accidentally entered an erroneous command to copy everything from the old HD to the new one and ended up corrupting the OS. However, the *first* thing that happened was that command zapped my Data.fs. It was located on the new HD with a symlink for the entire var dir going from the old HD to the new one. Fast foreward to this week. I've built a new server and transplanted my 500 GB HD. I told the server farm to check it thoroughly because I suspected the hardware may have gotten corrupted. They swear they did check it thoroughly. I have 2 Zope instances. On one, I moved the var to the new HD with the symlink. I also moved my MySQL database to the new HD. I left them alone while I was working on the other Zope instance. Lo and behold, without my doing anything, suddenly the Data.fs on the Zope instance on the new HD got rewritten to 0 bytes and the MySQL database got completely nuked! My server farm tells me it has nothing whatsoever to do with the hard drive or the OS, that both are in perfect condition. I say that's nonsense! What do you think? Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Redirecting
Hi; I have a Web site I'm building a shopping cart for that is built with a basic site template and an iframe where all the page-by-page info goes. I need to redirect the iframe to the address below, but when I use the current incantation, it replaces not just the iframe but the whole page! Can someone suggest a better idea? This is a python script: request = container.REQUEST response = request.RESPONSE response.redirect(request.BASE0 + '/EMarket/Our_Store/Main_frame.pt?category=' + category) TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Redirecting
Ugh. JS redirects create problems with the search engines. What I really want to do is fill the hole in the doughnut, to use a radio advertising term. That is, I have code before the page data referenced below, and I have code after it. I want to write the stuff referenced below into the hole. What's a good way to do this? TIA, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 12 Mar 2007 12:04 PM Subject: Re: [Zope] Redirecting --On 12. März 2007 11:55:52 -0400 [EMAIL PROTECTED] wrote: Hi; I have a Web site I'm building a shopping cart for that is built with a basic site template and an iframe where all the page-by-page info goes. I need to redirect the iframe to the address below, but when I use the current incantation, it replaces not just the iframe but the whole page! Can someone suggest a better idea? This is a python script: request = container.REQUEST response = request.RESPONSE response.redirect(request.BASE0 + '/EMarket/Our_Store/Main_frame.pt?category=' + category) TIA, This will of course redirect the whole page including all contents. You have to use Javascript. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] 'int' object has no attribute 'objectValues'
Hi; I've written this PT: span tal:define=batch here/quotes/objectValues; num python:len(batch) p tal:replace=python:here.randomNumber(num) / /span ...which calls this external method: import random def randomNumber(num): return random.random(num) ...and throws this error: Error Type: AttributeError Error Value: 'int' object has no attribute 'objectValues' Why? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] No space left on device
Hi; I'm moving everything over to a new server because the old server's OS is corrupt. I've d'l'd a 300MB *.zexp file from the old server. (I have to d'l it to my PC over a slow satellite connection, then upload it to the new server because of the corruption.) When I went to install it, I got this error: No space left on device Here's the entire traceback. Is this stating that it's too big for the temporary storage? Is there a way to increase that limit? I suppose I could create a new Data.fs with just this folder, but because of the above-mentioned, it's a nightmare downloading and then uploading it. TIA, Tony Traceback (innermost last): * Module ZPublisher.Publish, line 101, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module OFS.ObjectManager, line 543, in manage_importObject * Module OFS.ObjectManager, line 560, in _importObjectFromFile * Module ZODB.ExportImport, line 85, in importFile * Module Products.TransactionAgents, line 54, in new_commit * Module ZODB.Transaction, line 241, in commit * Module ZODB.Transaction, line 356, in _commit_objects * Module ZODB.Connection, line 344, in commit * Module ZODB.ExportImport, line 157, in _importDuringCommit * Module ZODB.TmpStore, line 87, in store IOError: [Errno 28] No space left on device AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] No space left on device
-Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Fri, 9 Mar 2007 4:49 AM Subject: Re: [Zope] No space left on device --On 9. März 2007 03:45:05 -0500 [EMAIL PROTECTED] wrote: Hi; I'm moving everything over to a new server because the old server's OS is corrupt. I've d'l'd a 300MB *.zexp file from the old server. (I have to d'l it to my PC over a slow satellite connection, then upload it to the new server because of the corruption.) When I went to install it, I got this error: No space left on device This is not a Zope issue but an issue of your system: your file system is *full*. In detail your /tmp filesystem system to be full. Either clear it or change the temporary directory for the Zope process by setting the TMPDIR environment variable. Where? I added this line to zopectl and rebooted: TMPDIR=/usr/local/zope/tmp (usr has plenty of space) but it didn't help. TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] No space left on device
Right, restarted. But it didn't work, Tino. Any ideas? -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Fri, 9 Mar 2007 6:28 AM Subject: Re: [Zope] No space left on device Maciej Wisniowski schrieb: Where? I added this line to zopectl and rebooted: rebooted? Lets hope you only restartet zope :-) Regards Tino AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Calling a Variable
Hi; I thought I could call a variable in a page template by defining it and then putting a ? in front of it in a URL, like this: html tal:define=global base_url here/baseURL; template_id string:index; here python:here.restrictedTraverse('s/c/x/root/en-us/Help') a href=?base_url/contactus.pt Please tell me what I'm doing wrong. TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Calling a Variable
Thanks for clarifying that! Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: zope@zope.org Sent: Thu, 8 Mar 2007 2:14 PM Subject: Re: [Zope] Calling a Variable On 3/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I thought I could call a variable in a page template by defining it and then putting a ? in front of it in a URL, like this: Incorrect, you can only use ? to interpolate variables into a path expression: span tal:define=foo string:bar tal:content=here/?foo/span The above example will look up 'bar' and render it as the content of the span. -- Martijn Pieters AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Iteration Over Non-sequence
Hi; I've written this code: html body span tal:define=global number here/quotes/randomNumber/span tabletrtd span metal:use-macro=here/en-us/quotes/?number/macros/quote/spanbr / /td/tr/table /body html ...and here's randomNumber, which is an External Method: def randomNumber(self): return randrange(1, len(self.objectValues()), 1) but it throws this error which ends with Iteration over non-sequence. Well, the folder from which it's supposed to select a quote holds nothing but a sequential number of page templates (named 1, 2, 3...). What am I doing wrong? TIA, Tony Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec Module Products.PageTemplates.PageTemplate, line 96, in pt_render - ZopePageTemplate at /footprints.by2012.com/en-us/Articles/Mine/America_How_It_Ends.pt Module TAL.TALInterpreter, line 190, in __call__ Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 671, in do_useMacro Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 702, in do_defineSlot Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 409, in do_optTag_tal Module TAL.TALInterpreter, line 394, in do_optTag Module TAL.TALInterpreter, line 389, in no_tag Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 671, in do_useMacro Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 671, in do_useMacro Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 409, in do_optTag_tal Module TAL.TALInterpreter, line 394, in do_optTag Module TAL.TALInterpreter, line 389, in no_tag Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 671, in do_useMacro Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 409, in do_optTag_tal Module TAL.TALInterpreter, line 394, in do_optTag Module TAL.TALInterpreter, line 389, in no_tag Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 637, in do_condition Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 569, in do_insertStructure_tal Module Products.PageTemplates.TALES, line 221, in evaluate - URL: /templates/frame_content_1 - Line 5, Column 0 - Expression: standard:'here/s/getRandomQuote' - Names: {'container': Folder instance at e3eca10, 'context': Folder instance at e3eca10, 'default': Products.PageTemplates.TALES.Default instance at 0x8a4b6cc, 'here': Folder instance at e3eca10, 'loop': SafeMapping instance at a8d3b90, 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x8a4b06c, 'nothing': None, 'options': {'args': ()}, 'repeat': SafeMapping instance at a8d3b90, 'request': HTTPRequest, URL=http://footprints.by2012.com/Articles/Mine/America_How_It_Ends.pt, 'root': Application instance at e03c380, 'template': ZopePageTemplate at /footprints.by2012.com/en-us/Articles/Mine/America_How_It_Ends.pt, 'traverse_subpath': [], 'user': Anonymous User} Module Products.PageTemplates.Expressions, line 174, in __call__ Module Products.PageTemplates.Expressions, line 169, in _eval Module Products.PageTemplates.Expressions, line 66, in render Module Products.PageTemplates.ZRPythonExpr, line 76, in call_with_ns Module Shared.DC.Scripts.Bindings, line 320, in __render_with_namespace__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec Module Products.PageTemplates.PageTemplate, line 96, in pt_render - ZopePageTemplate at /s/getRandomQuote Module TAL.TALInterpreter, line 190, in __call__ Module TAL.TALInterpreter, line 234, in interpret Module TAL.TALInterpreter, line 657, in do_useMacro Module Products.PageTemplates.TALES, line 221, in evaluate - URL: /s/getRandomQuote - Line 5, Column 0 - Expression: standard:'here/en-us/quotes/?number/macros/quote' - Names: {'container': Folder instance at e37d4d0, 'context': Folder instance at e37d4d0, 'default': Products.PageTemplates.TALES.Default instance at 0x8a4b6cc, 'here': Folder instance at e37d4d0, 'loop': SafeMapping instance at dbf08f0, 'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x8a4b06c, 'nothing': None, 'options': {'args': ()}, 'repeat': SafeMapping instance at dbf08f0, 'request': HTTPRequest,
[Zope] Pounding Python Eggs
Hi; I'm trying to install ZMySQLDA on a new server I'm building. I got this error: Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ZMySQLDA/__init__.py, line 91, in ? import DA File /usr/local/zope/instance1/Products/ZMySQLDA/DA.py, line 91, in ? from db import DB File /usr/local/zope/instance1/Products/ZMySQLDA/db.py, line 89, in ? import _mysql File build/bdist.freebsd-6.2-RELEASE-i386/egg/_mysql.py, line 7, in ? File build/bdist.freebsd-6.2-RELEASE-i386/egg/_mysql.py, line 4, in __bootstrap__ File /usr/local/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg/pkg_resources.py, line 799, in resource_filename return get_provider(package_or_requirement).get_resource_filename( File /usr/local/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg/pkg_resources.py, line 1228, in get_resource_filename self._extract_resource(manager, self._eager_to_zip(name)) File /usr/local/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg/pkg_resources.py, line 1249, in _extract_resource real_path = manager.get_cache_path( File /usr/local/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg/pkg_resources.py, line 880, in get_cache_path self.extraction_error() File /usr/local/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg/pkg_resources.py, line 846, in extraction_error raise err pkg_resources.ExtractionError: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) to the Python egg cache: [Errno 13] Permission denied: '/root/.python-eggs' The Python egg cache directory is currently set to: /root/.python-eggs Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory. Well, I don't have any .python-eggs file anywhere...nor on my old server either, that has ZMySQLDA functioning just fine (that is, if find / -name .python-eggs should turn something up). Furthermore, I'm using Pound, not Apache. What should I do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] ZMySQLDA Problem
Traceback (most recent call last): File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ZMySQLDA/__init__.py, line 91, in ? import DA File /usr/local/zope/instance1/Products/ZMySQLDA/DA.py, line 91, in ? from db import DB File /usr/local/zope/instance1/Products/ZMySQLDA/db.py, line 89, in ? import _mysql File build/bdist.freebsd-6.2-RELEASE-i386/egg/_mysql.py, line 7, in ? File build/bdist.freebsd-6.2-RELEASE-i386/egg/_mysql.py, line 6, in __bootstrap__ ImportError: Shared object libmysqlclient_r.so.15 not found, required by _mysql.so Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ZMySQLDA/__init__.py, line 91, in ? import DA File /usr/local/zope/instance1/Products/ZMySQLDA/DA.py, line 91, in ? from db import DB File /usr/local/zope/instance1/Products/ZMySQLDA/db.py, line 89, in ? import _mysql File build/bdist.freebsd-6.2-RELEASE-i386/egg/_mysql.py, line 7, in ? File build/bdist.freebsd-6.2-RELEASE-i386/egg/_mysql.py, line 6, in __bootstrap__ ImportError: Shared object libmysqlclient_r.so.15 not found, required by _mysql.so # find / -name libmysqlclient_r.so.15 /usr/local/lib/mysql/libmysqlclient_r.so.15 # find / -name bdist.freebsd-6.2-RELEASE-i386 /usr/src/MySQL-python-1.2.2/build/bdist.freebsd-6.2-RELEASE-i386 # ls /usr/src/MySQL-python-1.2.2/build/bdist.freebsd-6.2-RELEASE-i386/ # So, evidently, there isn't even a dir named egg under the given dir in which to look for said file! What do? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] ZMySQLDA Problem
# find / -name libmysqlclient_r.so.15 /usr/local/lib/mysql/libmysqlclient_r.so.15 # find / -name bdist.freebsd-6.2-RELEASE-i386 /usr/src/MySQL-python-1.2.2/build/bdist.freebsd-6.2-RELEASE-i386 # ls /usr/src/MySQL-python-1.2.2/build/bdist.freebsd-6.2-RELEASE-i386/ # It would appear that indeed libmysqlclient_r.so.15 is in fact to be found in the /usr/local/lib/mysql dir. So that would appear to not be the issue. Next, you state that it might not be found in its environment, and tell me I should try adding it using the LD_LIBRARY_PATH environment variable. Okay, but could you be more specific? How exactly do I do that? Or, where is a resource to learn how to do it? TIA, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 5 Mar 2007 8:19 AM Subject: Re: [Zope] ZMySQLDA Problem --On 5. März 2007 07:14:41 -0500 [EMAIL PROTECTED] wrote: __bootstrap__ ImportError: Shared object libmysqlclient_r.so.15 not found, required by _mysql.so Traceback (most recent call last): This is also self-speaking. The mysql client libaries are either not installed or can't be found. Check if the file is installed properly. If yes, try to extend the library search path of the dynamic linker using the LD_LIBRARY_PATH environment variable. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] ZMySQLDA Problem
Thank you for giving me that command, unfortunately, export is not found on my system (?). # export LD_LIBRARY_PATH=/usr/local/lib/mysql/ export: Command not found. # find / -name export # Is there another command? FreeBSD 6.2 TIA, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 5 Mar 2007 8:29 AM Subject: Re: [Zope] ZMySQLDA Problem --On 5. März 2007 07:26:10 -0500 [EMAIL PROTECTED] wrote: # find / -name libmysqlclient_r.so.15 /usr/local/lib/mysql/libmysqlclient_r.so.15 # find / -name bdist.freebsd-6.2-RELEASE-i386 /usr/src/MySQL-python-1.2.2/build/bdist.freebsd-6.2-RELEASE-i386 # ls /usr/src/MySQL-python-1.2.2/build/bdist.freebsd-6.2-RELEASE-i386/ # It would appear that indeed libmysqlclient_r.so.15 is in fact to be found in the /usr/local/lib/mysql dir. So that would appear to not be the issue. Next, you state that it might not be found in its environment, and tell me I should try adding it using the LD_LIBRARY_PATH environment variable. Okay, but could you be more specific? How exactly do I do that? Or, where is a resource to learn how to do it? TIA, Tony export LD_LIBRARY_PATH=/path/to/libdir1:/path/to/libdir2: -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] ZMySQLDA Problem
setenv Thanks! Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 5 Mar 2007 8:38 AM Subject: Re: [Zope] ZMySQLDA Problem --On 5. März 2007 07:35:19 -0500 [EMAIL PROTECTED] wrote: Thank you for giving me that command, unfortunately, export is not found on my system (?). # export LD_LIBRARY_PATH=/usr/local/lib/mysql/ export: Command not found. # find / -name export # you might read about the unix basics...setting an environment variable depends on the type of your shell. I have no idea which shell your using. Reading the man page of your shell and Goggle should give you an answer *wink*. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Problem On Rebuild
Hi; I'm building out a new server and trying to import all the functionality from the old OS-corrupted server. The Web site built on this server have a directory structure that's easy for identifying stuff but makes for long URLS: example.com/dir1/dir2/dir3/dir4/index.pt They're always the same dirs and they appear on every page of every site. The sysadmin before me had a neat little script buried somewhere that made those dirs disappear when they posted to a browser. That's important for SEO, since the SEs only go a couple dirs deep. But I'll be darned if I know where this guy put that script! I tried to tarball his old Zope build-out and unpack and use it, but I got this error: Error: The object named by DBTab.ClassFactories.autoClassFactory could not be imported Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/datatypes.py, line 106, in importable_name package = __import__(n, g, g, component) File /usr/local/zope/278/lib/python/DBTab/ClassFactories.py, line 18, in ? import OFS.Uninstalled File /usr/local/zope/278/lib/python/OFS/__init__.py, line 14, in ? import Products.ReplaceSupport.AdvancedPatch File /usr/local/zope/instance1/Products/ReplaceSupport/__init__.py, line 17, in ? import Handlers File /usr/local/zope/instance1/Products/ReplaceSupport/Handlers/__init__.py, line 30, in ? from Globals import package_home File /usr/local/zope/278/lib/python/Globals.py, line 23, in ? import Acquisition, ComputedAttribute, App.PersistentExtra, os File /usr/local/zope/278/lib/python/App/PersistentExtra.py, line 14, in ? from class_init import default__class_init__ File /usr/local/zope/278/lib/python/App/class_init.py, line 14, in ? from AccessControl.PermissionRole import PermissionRole File /usr/local/zope/278/lib/python/AccessControl/__init__.py, line 16, in ? import DTML File /usr/local/zope/278/lib/python/AccessControl/DTML.py, line 18, in ? from DocumentTemplate import DT_Util File /usr/local/zope/278/lib/python/DocumentTemplate/__init__.py, line 22, in ? from DocumentTemplate import String, File, HTML, HTMLDefault, HTMLFile File /usr/local/zope/278/lib/python/DocumentTemplate/DocumentTemplate.py, line 112, in ? from DT_String import String, File File /usr/local/zope/278/lib/python/DocumentTemplate/DT_String.py, line 17, in ? from DT_Util import ParseError, InstanceDict, TemplateDict, render_blocks, str File /usr/local/zope/278/lib/python/DocumentTemplate/DT_Util.py, line 42, in ? from cDocumentTemplate import InstanceDict, TemplateDict, \ ImportError: /usr/local/zope/278/lib/python/DocumentTemplate/cDocumentTemplate.so: Undefined symbol PyUnicodeUCS2_DecodeLatin1 I'm not sure if I should even be trying that, but I thought maybe he put the script in there, since I can't find it as a prod. or anything else through the ZCMI. Ideas? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Problem On Rebuild
-Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Mon, 5 Mar 2007 1:36 PM Subject: Re: [Zope] Problem On Rebuild You're running Zope with a different Python version/binary than the one used to compile and install Zope. Trible check that. I will; however, upon re-thinking this, it would be much better to know what file he edited, then edit the same. Does anyone have an idea what file one would edit in the Zope distro to capture the URL request and rewrite it, both on the way in and on the way out. TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Problem On Rebuild
-Original Message- From: [EMAIL PROTECTED] To: zope@zope.org; [EMAIL PROTECTED] Sent: Mon, 5 Mar 2007 2:19 PM Subject: Re: [Zope] Problem On Rebuild I missed the beginning of this thread so i don't know if i missed something relevant, but url rewriting in general is often done within the front-end web server (eg. Apache). Logical, but this isn't done at the Web server. These sites go through Pound, which is a reverse proxy, then are actually served by Zope itself. Then again, perhaps they're rewritten in Zope's Web server! Where would that be, for 2.7.8? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Resizing Images In Page Templates
Hi; I saw somewhere someone adding code like this: img src=myimage.jpg/resize / that would automatically resize his image according to a predetermined standard. Does anyone know how this or something similar is done? TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Resizing Images In Page Templates
Hmm. I have it working on the server from which I am moving to another server. I didn't build the code. But it sure does work just fine. Sorry. Not nonsense. Anyone else have any ideas? TIA, Tony -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; zope@zope.org Sent: Sun, 4 Mar 2007 10:16 AM Subject: Re: [Zope] Resizing Images In Page Templates --On 4. März 2007 09:10:13 -0500 [EMAIL PROTECTED] wrote: Hi; I saw somewhere someone adding code like this: img src=myimage.jpg/resize / that would automatically resize his image according to a predetermined standard. Does anyone know how this or something similar is done? TIA, This is nonsense. This code will generate an image with a fixed URL without any additional functionality - neither on the server nor on the client side. -aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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 )
Re: [Zope] Resizing Images In Page Templates
ImageTag_Hotfix. Got it! Thanks! Tony -Original Message- From: [EMAIL PROTECTED] To: zope@zope.org Sent: Sun, 4 Mar 2007 4:41 PM Subject: Re: [Zope] Resizing Images In Page Templates (Sun, Mar 04, 2007 at 09:20:06AM -0500) [EMAIL PROTECTED] wrote/schrieb/egrapse: Hmm. I have it working on the server from which I am moving to another server. I didn't build the code. But it sure does work just fine. Sorry. Not nonsense. Anyone else have any ideas? There is a photo resizing product that IIRC works like that. It lets you specify sizes and even some simple image manipulations in the image path. It's a bit older and I think it worked with PIL. It's in the products list on zope.org. You might want to look through those products. Regards, Sascha ___ 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 ) AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Re: ImportError: cannot import name base_hasattr
Maciej Wisniowski wrote: Take a look at pathes in your traceback: /usr/local/www/zope/278/lib/python /usr/local/zope/278/lib/python /usr/local/zope/instance1/Products Why there are two different(!) lib/python/ folders? I see the problem! And I know what caused it. So I rebuilt Zope from source and tried again. Unfortunately, I got the same_darn_error, just without the www dir: Traceback (most recent call last): File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/__init__.py, line 47, in startup _startup() File /usr/local/zope/278/lib/python/Zope/App/startup.py, line 45, in startup OFS.Application.import_products() File /usr/local/zope/278/lib/python/OFS/Application.py, line 650, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File /usr/local/zope/278/lib/python/OFS/Application.py, line 673, in import_product product=__import__(pname, global_dict, global_dict, silly) File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr TIA, Tony AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] Re: ImportError: cannot import name base_hasattr
Maciej Wisniowski recently responded something to the effect of that I should take a look at my PYTHONPATH and gave me the address for subscribing to Plone. Thank you. I subscribed and posted to Plone, but after a day have received no response :( I looked at my PYTHONPATH, as per your suggestion, but it seemed to be in order. Furthermore, if it were not correct, how could I pull up Zope in any case? I can launch Zope, I just have a problem with the below-mentioned product installation (and maybe others after it). TIA, Tony Hi: This really should go to the Plone list, but seeing as how I can't hit their site from either of my browsers, how can I subscribe to the list? I couldn't download Plone, either, so I just built it from tarballs from an earlier installation, tarballing all the products associated with it (Plone 2.1.4, I think). Then I loaded them up in Zope 2.7.8 and got this error: Traceback (most recent call last): File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 673, in import_product File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 47, in startup # drop privileges after setting up servers File /usr/local/www/zope/278/lib/python/Zope/App/startup.py, line 45, in startup File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 650, in import_products File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 673, in import_product File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr CMFPlone/utils.py has a class named base_hasattr, so what's the problem? Perhaps I need to delete all the *.pyc files from the other server from which I copied all these products? (Lot of work, avoiding that since I'm not sure it's necessary, and there aren't any in CMFPlone anyway.) TIA, Tony Check out the new AOL. Most comprehensive set of free safety and security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more. AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.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] ImportError: cannot import name base_hasattr
Hi: This really should go to the Plone list, but seeing as how I can't hit their site from either of my browsers, how can I subscribe to the list? I couldn't download Plone, either, so I just built it from tarballs from an earlier installation, tarballing all the products associated with it (Plone 2.1.4, I think). Then I loaded them up in Zope 2.7.8 and got this error: Traceback (most recent call last): File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 673, in import_product File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr Traceback (most recent call last): File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 50, in ? run() File /usr/local/zope/278/lib/python/Zope/Startup/run.py, line 19, in run start_zope(opts.configroot) File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 52, in start_zope starter.startZope() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 231, in startZope Zope.startup() File /usr/local/zope/278/lib/python/Zope/Startup/__init__.py, line 47, in startup # drop privileges after setting up servers File /usr/local/www/zope/278/lib/python/Zope/App/startup.py, line 45, in startup File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 650, in import_products File /usr/local/www/zope/278/lib/python/OFS/Application.py, line 673, in import_product File /usr/local/zope/instance1/Products/ATContentTypes/__init__.py, line 54, in ? import Products.ATContentTypes.content File /usr/local/zope/instance1/Products/ATContentTypes/content/__init__.py, line 34, in ? import Products.ATContentTypes.content.topic File /usr/local/zope/instance1/Products/ATContentTypes/content/topic.py, line 33, in ? from Products.CMFPlone.CatalogTool import CatalogTool File /usr/local/zope/instance1/Products/CMFPlone/CatalogTool.py, line 27, in ? from Products.CMFPlone.utils import base_hasattr ImportError: cannot import name base_hasattr CMFPlone/utils.py has a class named base_hasattr, so what's the problem? Perhaps I need to delete all the *.pyc files from the other server from which I copied all these products? (Lot of work, avoiding that since I'm not sure it's necessary, and there aren't any in CMFPlone anyway.) TIA, Tony Check out the new AOL. Most comprehensive set of free safety and security tools, free access to millions of high-quality videos from across the web, free AOL Mail and more. ___ 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 )