Re: [Zope] Sequence sorting module from a Python script

2005-04-24 Thread David H
Leticia Larrosa wrote: Hi all: I want to order a sequence using the Sequence sorting module from a Python script. I have the following code: " seq = [['Bruzon', 'CUB'], ['Anand', 'IND'], ['Kasparov', 'RUS']] def test(oneElem, twoElem): if oneElem[0] == twoElem[0]: return 0

Re: [Zope] Sequence sorting module from a Python script

2005-04-24 Thread Andreas Jung
--On Sonntag, 24. April 2005 17:36 Uhr -0400 Leticia Larrosa [EMAIL PROTECTED] wrote: sort_on =(('self', test, 'desc')) As documented the 'sort_on_ parameter must be a *sequence* of sorting definitions and a *single* sorting definition. This should work: sort_on =(('self', test, 'desc'),) -aj

Re: [Zope] sequence-item is a String? (was: Calling objects with arguments in asequence)sequence)

2000-09-29 Thread Dieter Maurer
seb writes: If you do: dtml-in "objectValues('Foo Thing')" dtml-let thing=sequence-item dtml-var "thing.id()" /dtml-let /dtml-in "sequence-item" is not a string. However, dtml-let ... xxx=name ... calls "name" (if callable) like any name argument to a "dtml"

Re: [Zope] sequence-item is a String? (was: Calling objects with arguments in asequence)sequence)

2000-09-28 Thread Chris McDonough
If you do: dtml-in "objectValues('Foo Thing')" dtml-let thing=sequence-item dtml-var "thing.id()" /dtml-let /dtml-in You get TypeError: it claims thing is a string, so you can't perform any kind of function call against it. Some id attributes of Zope objects are methods, some are

Re: [Zope] sequence-item is called in dtml-let assignment?

2000-09-28 Thread Chris Withers
seb wrote: If you do: dtml-in "objectValues('Foo Thing')" dtml-let thing=sequence-item dtml-var "thing.id()" /dtml-let /dtml-in You get TypeError: it claims thing is a string, so you can't perform any kind of function call against it. Welcome to

Re: [Zope] sequence-item and

2000-07-19 Thread Chris Withers
Jonothan Farr wrote: There's a much cooler and more elegant solution in the pipe for 2.2. http://www.zope.org/Members/4am/DTMLWiki/NamedDTMLInLoop I don't think this landed for 2.2... Chris ___ Zope maillist - [EMAIL PROTECTED]

Re: [Zope] sequence-item and

2000-07-18 Thread Christopher J. Kucera
Diego Rodrigo Neufert wrote: Why I cant use dtml-var "sequence-item"?? Because anything inside quotes is evaluated as a Python expression. It's trying to subtract 'item' from 'sequence.' Try: dtml-var "_['sequence-item']" -CJ ___ Zope maillist

Re: [Zope] sequence-item and

2000-07-18 Thread Chris Withers
"Christopher J. Kucera" wrote: Try: dtml-var "_['sequence-item']" or dtml-var "_getitem('sequence-item',0)" If you don't want the object to be called ebfore being displayed... cheers, Chris ___ Zope maillist - [EMAIL PROTECTED]

Re: [Zope] sequence-item and

2000-07-18 Thread Rob Miller
Diego Rodrigo Neufert writes: Hi ppl... Why I cant use dtml-var "sequence-item"?? Because, as I understand it, anything within "" gets treated as Python code by the DTML interpreter. Thus "sequence-item" is parsed as an expression: sequence _minus_ item. A dash is not a valid variable

Re: [Zope] sequence-item and

2000-07-18 Thread Jonothan Farr
worse than Python because people wanted it worse." Larry Wall, 14 Oct 1998 - Original Message - From: Rob Miller [EMAIL PROTECTED] To: Diego Rodrigo Neufert [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 18, 2000 1:30 PM Subject: Re: [Zope] sequence-item and "&quo

Re: [Zope] sequence-item as a method argument

2000-06-14 Thread Rik Hoekstra
Hello again I´m still testing the usability and reliability of Zope. To accomplish this goal I am developing a very very simple shopping cart. But I got troubled by something aparently simple. This is the code: dtml-in "SESSION['cartItems']" dtml-in

Re: [Zope] sequence-item as a method argument

2000-06-14 Thread Thomas Weiner
Fabio Akita schrieb: [ sequence-item in a python expression ] Error Type: NameError Error Value: sequence Anyone knows what is going on? I think this must be a simple thing. Everything in quotes is taken as a python expression, therefore Zope wants to evaluate "sequence - item"; this

Re: [Zope] sequence-*

2000-05-26 Thread Jonothan Farr
Many of these variables cause problems for those starting out with Zope. Why not create alternate names such as sequence_* and degrade the former? Gotta agree with this :-) Here's the patch. I'll submit it to the collector too. Enjoy.