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 obj.getI

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? > >>

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-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', 'DTM

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','Fil

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.objec

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', 'DTMLDocument','ZipFolde

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 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 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 or

[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 Garr

[Zope] Sorting Not Sorting

2007-08-03 Thread tonylabarbara
Hi; I have this code: ? ??? ? <> ??? ? ? ??? ??? ? ? ??? ? ??? 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

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 on

[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 is broken with UTF-8?

2005-04-14 Thread Andreas Jung
--On Donnerstag, 14. April 2005 15:25 Uhr +0200 Daniel Dekany <[EMAIL PROTECTED]> wrote: I see, but then my question is: How do people use Zope for sites where "Unicode" is needed? They just don't use Zope in such cases? At my new employer here is fat Plone site running for months with the menti

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

2005-04-14 Thread Daniel Dekany
Thursday, April 14, 2005, 12:35:37 PM, Andreas Jung wrote: > --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 >> DocumentT

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: accente

[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 'in'

2000-11-06 Thread Andy McKay
OTECTED]> 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 &

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) so

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 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 spande

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 > ~~~

[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 things?Cyc

Re: [Zope] Sorting and accessing elements in the

2000-10-03 Thread Andy McKay
Although this could be simpler (you dont need the REQUEST.set): : - Original Message - From: "Max Møller Rasmussen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 03, 2000 8:05 AM Subject: [Zope] Sorting and accessing elements in

Re: [Zope] Sorting and accessing elements in the

2000-10-03 Thread Andy McKay
tober 03, 2000 8:05 AM Subject: [Zope] Sorting and accessing elements in the > 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-ma

[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 predictabl

Re: [Zope] sorting problem

2000-09-29 Thread Michael Bernstein
Tim Cook wrote: > > Michael Bernstein wrote: > > > > Here's my problem: I want to sort a list of objects on a property that > > not all items have. So I'm doing this: > > > > > > > > The problem is that those items that have a blank someProperty are > > listed first, when I want them at the bott

Re: [Zope] sorting problem

2000-09-28 Thread Tim Cook
Michael Bernstein wrote: > > Hello all, > > Here's my problem: I want to sort a list of objects on a property that > not all items have. So I'm doing this: > > > > The problem is that those items that have a blank someProperty are > listed first, when I want them at the bottom of the list. I

[Zope] sorting problem

2000-09-28 Thread Michael Bernstein
Hello all, Here's my problem: I want to sort a list of objects on a property that not all items have. So I'm doing this: The problem is that those items that have a blank someProperty are listed first, when I want them at the bottom of the list. I don't want to reverse the entire sort order, I

[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: /edit">edit /delete">delete I want somet

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 the list gets > sorted on the sequence-key not the sequence-item. As I understand the > alp

[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 the list gets sorted on the sequence-key not the sequence-item. As I understand the alphabetical characters are the sequence-keys

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 20

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

2000-07-04 Thread Jerome Alet
On Tue, 4 Jul 2000, Pieter Claerhout wrote: > if I'm iterating over a list using the dtml-in tag, is it then possible > to sort the items descending? IIRC: bye, Jerome ALET - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 3

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

2000-07-04 Thread Oleg Broytmann
On Tue, 4 Jul 2000, Pieter Claerhout wrote: > if I'm iterating over a list using the dtml-in tag, is it then possible > to sort the items descending? Oleg.(All opinions are mine and not of my employer) Oleg Broytmann Foundation for Effective Policies [EMAIL PR

[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] http://lists.zope.org/mailman/listi

[Zope] Sorting dtml-in with properties

2000-05-19 Thread Adrian Esteban Madrid
Can you do a sort in a dtml-in by a propety of the object? What I want to do is sort the documents in a folder by a fixed number set in a property of that document. I tried something like this but it didn't work. Any ideas how this could be accomplished? Adrian __