I am having a problem with specifying the properties when I create
an object I have built using a ZClass. This python
script is what I am using to create the object:
# in the current context (the place
the factory was called from).
content=container.Content.createInObjectManager(REQUEST['id'],
REQUEST)
request = context.REQUEST
# Create Content
content.manage_addProduct['Content']
# Change Properties
---------------------------------------------------------------------------------------------------------------------------------------
----- I am having problems here the SortOrder
property is always made 1.
---------------------------------------------------------------------------------------------------------------------------------------
# Change Sort Order
SortOrder=(len(context.objectValues('Content')) + 1)
if SortOrder is not 0:
content.manage_changeProperties(SortOrder=SortOrder)
---------------------------------------------------------------------------------------------------------------------------------------
----nothing appears in this property even if I specify
something in the form to create the object
---------------------------------------------------------------------------------------------------------------------------------------
# Change Content Text
if ContentText is not None:
content.manage_changeProperties(ContentText='ContentText')
# Change Author
user=AUTHENTICATED_USER.getUserName()
content.propertysheets.userProperties.manage_changeProperties(Author=user)
#Change Title
if title is not None:
content.manage_changeProperties(title=title)
# Change Paragraph
if para is not None:
content.propertysheets.userProperties.manage_changeProperties(para=para)
# Change Bold
if bold is not None:
content.propertysheets.userProperties.manage_changeProperties(bold=bold)
# Change Italic
if italic is not
None:
content.propertysheets.userProperties.manage_changeProperties(italic=italic)
# Change Underline
if underline is not
None:
content.propertysheets.userProperties.manage_changeProperties(underline=underline)
if request:
# redirect to the management view of the instance's container
request.RESPONSE.redirect(content.aq_parent.absolute_url()
+ '/manage_main')
else:
#
If we aren't supposed to redirect (ie, we are called
from a script)
#
then just return the ZClass
instance to the caller
return content
Thanks in advance,
Jamie