diff tools/xml_tools.py @ 91:39c672544593

Tarot: bidding phase - quick_app: command line is now parsed, "profile" option allow to select it - xml_tools: list-single is now managed - plugin tarot: method and signal to manage contract (contrat): tarotChooseContrat & tarotGameContratChoosed - wix: Q&D Form hack to manage more generic form (not only registration), used to show contract selection form
author Goffi <goffi@goffi.org>
date Thu, 27 May 2010 19:26:19 +0930
parents a5b5fb5fc9fd
children be206a3d1a9b
line wrap: on
line diff
--- a/tools/xml_tools.py	Sun May 23 16:39:05 2010 +0930
+++ b/tools/xml_tools.py	Thu May 27 19:26:19 2010 +0930
@@ -50,6 +50,8 @@
                 __field_type = "string"
             elif field.fieldType == 'text-private':
                 __field_type = "password"
+            elif field.fieldType == 'list-single':
+                __field_type = "list"
             else:
                 error (u"FIXME FIXME FIXME: Type [%s] is not managed yet by SàT" % field.fieldType)
                 __field_type = "string"
@@ -59,9 +61,12 @@
             elem.setAttribute('type', __field_type)
             elem.setAttribute('label', field.label or "")
             if field.value:
-                text = doc.createTextNode(field.value)
-                elem.appendChild(text)
+                elem.setAttribute('value', field.value)
             top_element.appendChild(elem)
+            for option in field.options:
+                opt = doc.createElement('option')
+                opt.setAttribute('value', option.value)
+                elem.appendChild(opt)
         result = doc.toxml()
         doc.unlink()
         return result