[Zapp-cvs-commit] ZApp/skins/zapp_generic zapp_cmf_object_edit.py,1.5,1.6 zapp_cmf_object_edit_form.
Brought to you by:
sspickle
Update of /cvsroot/zapp/ZApp/skins/zapp_generic
In directory sc8-pr-cvs1:/tmp/cvs-serv5312/skins/zapp_generic
Modified Files:
zapp_cmf_object_edit.py zapp_cmf_object_edit_form.pt
zapp_cmf_object_type_edit_form.pt zapp_cmf_object_view.pt
Log Message:
make CMF object a bit more flexible WRT attribute management
Index: zapp_cmf_object_edit.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_edit.py 24 Nov 2003 16:45:35 -0000 1.5
--- zapp_cmf_object_edit.py 8 Jan 2004 11:20:26 -0000 1.6
***************
*** 37,41 ****
dict.update(inputDict)
! submitValue = context.REQUEST.get('submit','')
if submitValue == 'add row':
--- 37,48 ----
dict.update(inputDict)
! dataType = dict.get('zapp_dataType','')
! clearFlag = dict.get('zapp_misc_data_clear',0)
!
! submitValue = dict.get('submit','')
!
! for key in ['submit', 'zapp_dataType', 'zapp_misc_data_clear']:
! if dict.has_key(key):
! del dict[key]
if submitValue == 'add row':
***************
*** 63,67 ****
dict[propName] = inputValue[0][0]
! context.safeMiscData.setXMLAttrs(dict = dict)
context.reindexObject()
--- 70,76 ----
dict[propName] = inputValue[0][0]
! mdObject = context.getMiscData(dataType=dataType, createIfNone=1)
! mdObject.setXMLAttrs(dict = dict, zapp_misc_data_clear=clearFlag)
!
context.reindexObject()
Index: zapp_cmf_object_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_edit_form.pt,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_edit_form.pt 31 Dec 2003 18:04:21 -0000 1.5
--- zapp_cmf_object_edit_form.pt 8 Jan 2004 11:20:26 -0000 1.6
***************
*** 37,40 ****
--- 37,43 ----
myProperties python:here.safeMiscData.getXMLDict()">
+ <div>
+ My Portal Type: <span tal:content="here/portal_type"/>
+ </div>
<table tal:condition="myPropSet">
<form action="." tal:attributes="action string:${here/getId}/zapp_cmf_object_edit" method="post">
Index: zapp_cmf_object_type_edit_form.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_type_edit_form.pt,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** zapp_cmf_object_type_edit_form.pt 28 Oct 2003 20:27:04 -0000 1.5
--- zapp_cmf_object_type_edit_form.pt 8 Jan 2004 11:20:26 -0000 1.6
***************
*** 41,45 ****
'name': is the name of the property
! 'type': is it's type simple types like: 'float','int','long','string','date','boolean',
complex types like: 'int:list', (a list of values, the type specified before the ':' is the type of each value),
'record' (a structure or dictionary),
--- 41,45 ----
'name': is the name of the property
! 'type': is it's type simple types like: 'float','int','long','string','date',
complex types like: 'int:list', (a list of values, the type specified before the ':' is the type of each value),
'record' (a structure or dictionary),
***************
*** 59,62 ****
--- 59,65 ----
myTPropsMiscData python:typePropertiesObjects and typePropertiesObjects[0].getXMLDict();
myPropSet myTPropsMiscData/zapp_properties | nothing">
+ <div>
+ My Portal Type: <span tal:content="here/portal_type"/>
+ </div>
<form action="." tal:attributes="action string:${here/getId}/zapp_cmf_object_type_edit" method="post">
***************
*** 68,72 ****
subDefs subObject/zapp_properties | python:[]">
! <table tal:condition="python:propType in ['float','int','long','string','date','boolean','text']">
<tr><td><input type="checkbox" name="names:list" tal:attributes="value propName"/></td> <td tal:content="string:${propName}(${propType})"/></tr>
</table>
--- 71,75 ----
subDefs subObject/zapp_properties | python:[]">
! <table tal:condition="python:propType in ['float','int','long','string','date','text']">
<tr><td><input type="checkbox" name="names:list" tal:attributes="value propName"/></td> <td tal:content="string:${propName}(${propType})"/></tr>
</table>
***************
*** 93,97 ****
<td>
<select name="newItem.propType:record">
! <span tal:repeat="item python:['string','text','float','int','long','date','boolean','array','record','records']">
<option tal:attributes="value item" tal:content="item"/>
</span></select> </td>
--- 96,100 ----
<td>
<select name="newItem.propType:record">
! <span tal:repeat="item python:['string','text','float','int','long','date','record','records']">
<option tal:attributes="value item" tal:content="item"/>
</span></select> </td>
Index: zapp_cmf_object_view.pt
===================================================================
RCS file: /cvsroot/zapp/ZApp/skins/zapp_generic/zapp_cmf_object_view.pt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** zapp_cmf_object_view.pt 31 Dec 2003 18:04:21 -0000 1.6
--- zapp_cmf_object_view.pt 8 Jan 2004 11:20:26 -0000 1.7
***************
*** 18,22 ****
myProperties python:here.safeMiscData.getXMLDict()">
! Raw Data View (this screen apparently has no skin yet.. )
<div tal:content="myTypePropertiesMiscData"> </div>
--- 18,25 ----
myProperties python:here.safeMiscData.getXMLDict()">
! <div>
! Raw Data View (this screen apparently has no skin yet.. ) <br>
! My Portal Type: <span tal:content="here/portal_type"/>
! </div>
<div tal:content="myTypePropertiesMiscData"> </div>
|