[CPS-devel] filterContents-signature

Anahide Tchertchian at at nuxeo.com
Fri Jun 30 12:26:30 CEST 2006


Joachim Schmitz a écrit :
> I read in CPSDefault.utils, that the signature for filterContents is:
> def filterContents(context, items, sort_on=None, sort_order=None,
>                    filter_ptypes=None, hide_folder=False):
> 
> when I call this in a pagetemplate like this:
> items python:context.filterContents(context.contentValues(),sort_on='id')
> i get
> 
> TypeError: filterContents() got an unexpected keyword argument 'sort_on'
> 
> ???
> 

Hi,

The CPSDefault.utils method cannot be called like that from a page
template: you're in fact calling the
CPSDefault/skins/cps_default/filterContents.py script, which probably
does a similar thing, but does not take the same parameters.
If you'd like to use the utils one, you should do:
tal:define="
   filterContents nocall:modules/Products.CPSDefault.utils/filterContents;
   items python:filterContents(context, context.contentValues(),
sort_on='id')"

Regards,

-- 
Anahide Tchertchian, Nuxeo
Mail: at at nuxeo.com - Tel: +33 (0)1 40 33 71 60
http://www.nuxeo.com - http://www.cps-project.org



More information about the cps-devel mailing list

This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.