"Inherit" default fields from a template to a new content type

Victor Fernandez <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
Hello,

I have to integrate a Poi tracker in my site, and I want to have the ability to
inherit some values existing in the page (template view of another content type)
from I'm calling the creation of a new PoiIssue. (I have isolated the button of
the poi tracker that creates a new PoiIssue).

This is the example problem, but the abstract problem is that: There is a way of
inherit the value of the contents from a template view (from any content type),
to make them avaliable as default content of another content type? Of course,
via a button that calls a script that create the content, one like createObject
script.

I have made progress with the method "invokeFactory" but the problem comes when
I want to use the portal_factory to avoid the creation of empty objects. I have
modified the script createObject, but it is not possible to modify the value of
a field in the portal_factory because it is a temporary object... If we
instantiate the object with the method portal_factory.doCreate(), and then I can
modify the value via its default mutator, but if the user doesn't completes the
form, then one empty object is created...

  new_context = context.portal_factory.doCreate(o, id)
  new_context.setNecessitat('hola')
  return state.set(context=new_context)

Can anyone help me?

Thanks in advance.





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.