Mercurial > hg > ZDBInterface
changeset 17:48ed91b29784
added stuff from RestDbGisApi to WritableRestDbInterface.
changed meta_type of RestDbInterface (remove "2").
author | casties |
---|---|
date | Thu, 23 Feb 2012 08:33:48 +0100 |
parents | 5b99c04c567c |
children | 60fea3a6c695 |
files | RestDbInterface.py WritableRestDbInterface.py version.txt |
diffstat | 3 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/RestDbInterface.py Wed Feb 22 18:53:05 2012 +0100 +++ b/RestDbInterface.py Thu Feb 23 08:33:48 2012 +0100 @@ -27,7 +27,7 @@ """ implements(IPublishTraverse) - meta_type="RESTdb2" + meta_type="RESTdb" manage_options=Folder.manage_options+( {'label':'Config','action':'manage_editRestDbInterfaceForm'}, )
--- a/WritableRestDbInterface.py Wed Feb 22 18:53:05 2012 +0100 +++ b/WritableRestDbInterface.py Thu Feb 23 08:33:48 2012 +0100 @@ -231,14 +231,30 @@ colNodes=node[1].getElementsByTagNameNS(namespace, colTagName) data = [] hasData = False + # TODO: check this index stuff + lineIndex=0 for colNode in colNodes: + lineIndex+=1 dataNodes=colNode.getElementsByTagNameNS(namespace, dataTagName) if len(dataNodes) > 0: - val = getTextFromNode(dataNodes[0]) - hasData = True + dataIndex=0 + if colNode.hasAttribute(u'ss:Index'): + dataIndex=int(colNode.getAttribute(u'ss:Index')) + while dataIndex>lineIndex: + data.append(None) + lineIndex+=1 + else: + val = getTextFromNode(dataNodes[0]) + hasData = True else: val = None - + + # TODO: check this + if val!=None: + a=val.rfind('.0') + b=len(val) + if a==b-2: + val=val.rpartition('.')[0] data.append(val) if not hasData: