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: [EMAIL PROTECTED] - Tel: +33 (0)1 40 33 71 60
http://www.nuxeo.com - http://www.cps-project.org

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to