Re: [Zope] sorting ids in python

2008-12-11 Thread robert rottermann
Garry Saddington schrieb: On Tuesday 09 December 2008 03:15, Andreas Jung wrote: On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML

Re: [Zope] sorting ids in python

2008-12-11 Thread Peter Bengtsson
2008/12/11 robert rottermann [EMAIL PROTECTED]: Garry Saddington schrieb: On Tuesday 09 December 2008 03:15, Andreas Jung wrote: On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in

Re: [Zope] sorting ids in python

2008-12-11 Thread Andreas Jung
On 11.12.2008 12:28 Uhr, Peter Bengtsson wrote: Personally I prefer to always use objectValues(). Sorting isn't objectXXX()'s problem. It's something you do in your view. objs = list(self.objectValues()) objs.sort(lambda x,y: cmp(x.id, y.id)) Never ever use obj.id. The official API is

Re: [Zope] sorting ids in python

2008-12-09 Thread Garry Saddington
On Tuesday 09 December 2008 03:15, Andreas Jung wrote: On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']):

Re: [Zope] sorting ids in python

2008-12-09 Thread Andreas Jung
On 09.12.2008 8:45 Uhr, Garry Saddington wrote: On Tuesday 09 December 2008 03:15, Andreas Jung wrote: On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder',

[Zope] sorting ids in python

2008-12-08 Thread Garry Saddington
Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): Import of sequence is not authorised in my python scripts, I am presuming (probably wrongly) that sequence is needed for sort. Regards

Re: [Zope] sorting ids in python

2008-12-08 Thread Andreas Jung
On 08.12.2008 18:18 Uhr, Garry Saddington wrote: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): ids = context.objectIds() ids.sort() -aj begin:vcard fn:Andreas Jung n:Jung;Andreas

Re: [Zope] sorting ids in python

2008-12-08 Thread Andreas Jung
On 08.12.2008 19:23 Uhr, Andreas Jung wrote: On 08.12.2008 18:18 Uhr, Garry Saddington wrote: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): ids = context.objectIds() Possibly you

Re: [Zope] sorting ids in python

2008-12-08 Thread robert rottermann
Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): objs=context.objectValues(['Folder', 'DTMLDocument','ZipFolder','File','Image']) objs.sort() for o in objs:

Re: [Zope] sorting ids in python

2008-12-08 Thread Andreas Jung
On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): objs=context.objectValues(['Folder',

Re: [Zope] sorting ids in python

2008-12-08 Thread robert rottermann
Andreas Jung schrieb: On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): objs=context.objectValues(['Folder',

[Zope] Sorting Not Sorting

2007-08-03 Thread tonylabarbara
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'),); ??

[Zope] sorting

2007-01-25 Thread Kate Legere
I'd like to sort the items in a folder by relevance, relevance being a property I've assigned. I'm using a python script for aj in ao.objectItems(items): aao=aj[1] #the object title=aao.title id=aj[0] aanum=len(aao.objectIds())

Re: [Zope] sorting

2007-01-25 Thread Andreas Jung
--On 25. Januar 2007 15:03:19 -0500 Kate Legere [EMAIL PROTECTED] wrote: values=ao.objectItems(items) values.sort(lambda a,b: cmp(a[0],b[0])) Error Type: AttributeError Error Value: 'tuple' object has no attribute 'sort' This error message is self-explaining. You can

[Zope] Sorting is broken with UTF-8?

2005-04-14 Thread Daniel Dekany
I have a Zope 2.7.0(+Plone) instance that uses utf-8 encoding everywhere. The problem is that alphabetical sorting (like with DocumentTemplate.sequence.sort(seq, 'locale', ...)) is broken everywhere: accented letters come after all US-ASCII characters. I have locale=hu_HU.UTF-8 in zope.conf, still

Re: [Zope] Sorting is broken with UTF-8?

2005-04-14 Thread Andreas Jung
--On Donnerstag, 14. April 2005 12:20 Uhr +0200 Daniel Dekany [EMAIL PROTECTED] wrote: I have a Zope 2.7.0(+Plone) instance that uses utf-8 encoding everywhere. The problem is that alphabetical sorting (like with DocumentTemplate.sequence.sort(seq, 'locale', ...)) is broken everywhere: accented

[Zope] Sorting 'in'

2000-11-06 Thread Yvonne Totty
Hi! I need a query sorted by 2-3 different attributes. The 'in' sort only lets me do it by one. Is there a way to get around it? TIA -y ~~~ Yvonne Totty Database Engineer - Wolverine: You actually go outside in these

Re: [Zope] Sorting 'in'

2000-11-06 Thread Daniel Rusch
If it's a database query sorting with sql first. i.e. ORDER BY X,Y HTH Dan Yvonne Totty wrote: Hi! I need a query sorted by 2-3 different attributes. The 'in' sort only lets me do it by one. Is there a way to get around it? TIA -y ~~~ Yvonne

RE: [Zope] Sorting 'in'

2000-11-06 Thread Yvonne Totty
Yes, that is what I am doing, however was wanting to not have to write several Z SQL Methods. 8) ~~~ Yvonne Totty Database Engineer - Wolverine: You actually go outside in these things? Cyclops: Well, what would you prefer? Yellow

Re: [Zope] Sorting 'in'

2000-11-06 Thread Gregory Haley
hi yvonne, in your zsql method, you can order by several variables in the same method call. so you can do it all in one method. ciao! greg. Gregory Haley Venaca.com Yvonne Totty wrote: Yes, that is what I am doing, however was wanting to not have to write several Z SQL Methods. 8)

Re: [Zope] Sorting 'in'

2000-11-06 Thread Steve Spicklemire
Hi Yvonne, You could use Zieve, (http://www.zope.org/Members/sspickle/Zieve) or you could render the 'order by' part of your clause from a variable in the name space, or possibly the REQUEST itself. There was also a patch submitting at one point that allows variable (and I think multiple)

Re: [Zope] Sorting 'in'

2000-11-06 Thread Andy McKay
TECTED] Sent: Monday, November 06, 2000 8:17 AM Subject: RE: [Zope] Sorting 'in' Yes, that is what I am doing, however was wanting to not have to write several Z SQL Methods. 8) ~~~ Yvonne Totty Database Engineer - Wolverine: You

[Zope] Sorting and accessing elements in the

2000-10-03 Thread Max Møller Rasmussen
I am making a mailer zClass where it will only be nessecary to make the form fields with the values you want to send, then the zClass will give you a reply on the webpage and send a nicely formatted e-mail. The problem is that the form elements are unknown but they need to be set up in

Re: [Zope] Sorting and accessing elements in the

2000-10-03 Thread Andy McKay
ce-itemdtml-var item: dtml-var "REQUEST.form[item]" /dtml-let /dtml-in dtml-var standard_html_footer - Original Message - From: "Max Møller Rasmussen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 03, 2000 8:05 AM Subject: [Zope] Sorting and

[Zope] Sorting XML nodes?

2000-07-31 Thread Jean Jordaan
Hi Zopers (and Lex), From the (excellent) 'How-To: XMLDocument Example' (Created by eukreign. Last modified on 2000/06/06) I get the following to display all the nodes of an XML document: dtml-in "contacts[0].getElementsByTagName('contact')" tr td dtml-var

[Zope-dev] Re: [Zope] Sorting a list

2000-07-10 Thread Dieter Maurer
RC Compaan writes: I have a list: mylist=[('R',31),('I',80),('A',80),('S',23),('E',35),('C',21)] I want to rebuild the list sorted from high to low on the sequence-item. When i call dtml-in mylist sort=sequence-item reverse the list gets sorted on the sequence-key not the

Re: [Zope] Sorting a list

2000-07-10 Thread Dieter Maurer
RC Compaan writes: I have a list: mylist=[('R',31),('I',80),('A',80),('S',23),('E',35),('C',21)] I want to rebuild the list sorted from high to low on the sequence-item. When i call dtml-in mylist sort=sequence-item reverse the list gets sorted on the sequence-key not the

[Zope] Sorting a list

2000-07-08 Thread RC Compaan
I have a list: mylist=[('R',31),('I',80),('A',80),('S',23),('E',35),('C',21)] I want to rebuild the list sorted from high to low on the sequence-item. When i call dtml-in mylist sort=sequence-item reverse the list gets sorted on the sequence-key not the sequence-item. As I understand the

[Zope] Sorting a list descending using dtml-in

2000-07-04 Thread Pieter Claerhout
Hello, if I'm iterating over a list using the dtml-in tag, is it then possible to sort the items descending? Pieter Pieter Claerhout Application Support - CreoScitex Europe ___ Zope maillist - [EMAIL PROTECTED]

RE: [Zope] Sorting a list descending using dtml-in

2000-07-04 Thread Pieter Claerhout
Seems to work fine in Zope 2.1.6... Pieter -Original Message- From: Jerome Alet [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 04, 2000 3:48 PM To: Pieter Claerhout Cc: '[EMAIL PROTECTED]' Subject: Re: [Zope] Sorting a list descending using dtml-in On Tue, 4 Jul 2000, Pieter