You haven't told us what you want to *do*.
What's context.aq_parent.getId() supposed to do?
Florent
On 15 Jun 2006, at 13:18, JoseLuis de la Rosa Triviño wrote:
I modified the expression to
{{{python:portal.portal_directories.members[context.aq_parent.getId
()].center}}}
I have problems to get the folder where this content was just
created in. For this statement context.aq_parent.getId(), context
is None. Even object and proxy are None too.
I've also tried to create a new field "id" in the same schema to
set it (when the content is created) to the value I need. In that
case, the statement would look like this
{{{python:portal.portal_directories.members[id].center}}}
but even here id is None.
This expression is assessed in the same transaction that the
content is created, may that be a problem?
Thank you very much.
JoseLuis de la Rosa Triviño
Becario Área de Sistemas de Información
FUNDACIÓN IAVANTE
[EMAIL PROTECTED]
Tel. 951 015 300
Este correo electrónico y, en su caso, cualquier fichero anexo,
contiene información confidencial exclusivamente dirigida a su(s)
destinatario(s). Toda copia o divulgación deberá ser autorizada por
IAVANTE.
This e-mail and any attachments are confidential and exclusively
directed to its adressee(s). Any copy or distribution will have to
be authorized by IAVANTE.
-----Mensaje original-----
De: Florent Guillaume [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 15 de junio de 2006 1:10
Para: List CPS-devel
Asunto: Re: [CPS-devel] Re: context not available in read
expression forcreation of documents
On 14 Jun 2006, at 21:08, Yves Bastide wrote:
JoseLuis de la Rosa Triviño wrote:
I'm using this expression
{{{python:context.portal_directories.members
[context.aq_parent.getId()].center}}} as "Read: Expression" for a
schema field. It works fine when the document is already created,
but when I create a new content an exception is raised because
context is None and it can't get portal_directories.
[...]
The question is: what can I use instead of context to get that
field from members entry?
What's your expression returning? Can it use user? The namespace
is defined in CPSSchemas.Field._createStorageExpressionContext, I
think.
And documented in CPSShemas/doc/fields.txt (maybe not completely up
to date).
Florent
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED]
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED]
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel