[Zope] How to set selected items in multi-select list from lines property

Andreas Jung lists at zopyx.com
Mon Jun 5 02:03:15 EDT 2006



--On 4. Juni 2006 12:42:38 -1000 John Schinnerer <john at eco-living.net> 
wrote:


>
> So far I am only coming up with what seem to be cumbersome solutions that
> have unecessary overhead (comparing a list option with every element in
> lines property via python script to see if it should be set selected, and
> repeating for every list option)...is there a better way?
>

Since you have to compare each item of the option list against a given list 
of items you *must* do this comparison...how else would you be able which 
items should be selected. The only optimization I can imagine is to convert 
the the list of given items into a dict to perform a lookup in constant 
time instead of O(length_of_given_list).

-aj


-- 
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info at zopyx.com - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope & Plone development, Consulting
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20060605/ea51515a/attachment.bin


More information about the Zope mailing list