Hi JoseLuis, This is a workaround easing the integration. It's worst integrating it. Can you enter a ticket about this so that we can integrate your patch within CPS-3.4 please ? Thanks for your contribution. Regards, J. JoseLuis de la Rosa Triviño wrote: > Hello all! > > > > I've found this snippet in CommentTool.py inside CPSForum product: > > > > def getParentFolder(proxy): > > """Returns 'Section' or 'Workspace' parent folder.""" > > parent = proxy.aq_inner.aq_parent > > while parent: > > if hasattr(parent, 'portal_type') and \ > > (parent.portal_type == 'Section' or > > parent.portal_type == 'Workspace'): > > return parent > > parent = parent.aq_inner.aq_parent > > return proxy.aq_inner.aq_parent > > > > I had some problem with this as I have a new type of folder which type > is "WorkspaceCustomized". > > What I propose to improve this code is to add a new attribute to the > class, let's say: > > > > parentTypes = ['Section', 'Workspace',] ## This would be the > initial value for a CPSDefault Site > > > > and modify the procedure as this: > > > > def getParentFolder(proxy): > > """Returns parent folder.""" > > parent = proxy.aq_inner.aq_parent > > while parent: > > if hasattr(parent, 'portal_type') and > (parent.portal_type in parentTypes): > > return parent > > parent = parent.aq_inner.aq_parent > > return proxy.aq_inner.aq_parent > > > > I implemented this for my own site, and I thought it would be useful for > any site. Is this possible to apply it to the original code? > > > > On the other side, Is there a way to define a type of content as a > subtype of another? I mean, is there any way of inheritance between > content types? > > > > Thank you very much. > > > > Best regards, joseluis. > > *JoseLuis de la Rosa Triviño* > *Becario Área de Sistemas de Información* > FUNDACIÓN IAVANTE > joseluis.rosa at iavantefundacion.com > 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. > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > cps-devel mailing list > http://lists.nuxeo.com/mailman/listinfo/cps-devel -- Julien Anguenot | Nuxeo R&D (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://lists.nuxeo.com/pipermail/cps-devel/attachments/20060209/50858d51/signature.pgp
Hosting: Nuxeo: Zope service provider