1.1 --- a/XSLForms/Fields.py Wed Dec 22 00:40:24 2004 +0000
1.2 +++ b/XSLForms/Fields.py Thu Dec 23 15:07:37 2004 +0000
1.3 @@ -1,6 +1,11 @@
1.4 #!/usr/bin/env python
1.5
1.6 """
1.7 +NOTE: Add support for multiple values from fields, perhaps using
1.8 +NOTE: the following notation:
1.9 +NOTE:
1.10 +NOTE: /package#1/categories#1/category#n/value
1.11 +
1.12 Classes which process field collections, producing instance
1.13 documents. Each field entry consists of a field name mapped
1.14 to a string value, where the field name may have the following
1.15 @@ -73,16 +78,6 @@
1.16 if model_name is None:
1.17 continue
1.18
1.19 - # Convert from lists if necessary.
1.20 -
1.21 - if self.values_are_lists:
1.22 - value = value[0]
1.23 -
1.24 - # Convert the value to Unicode if necessary.
1.25 -
1.26 - if type(value) == type(""):
1.27 - value = unicode(value, encoding=self.encoding)
1.28 -
1.29 # Get a new instance document if none has been made for the
1.30 # model.
1.31
1.32 @@ -95,6 +90,17 @@
1.33 for component in components:
1.34 t = component.split(Constants.pair_separator)
1.35 if len(t) == 1:
1.36 +
1.37 + # Convert from lists if necessary.
1.38 +
1.39 + if self.values_are_lists:
1.40 + value = value[0]
1.41 +
1.42 + # Convert the value to Unicode if necessary.
1.43 +
1.44 + if type(value) == type(""):
1.45 + value = unicode(value, encoding=self.encoding)
1.46 +
1.47 node.setAttributeNS(EMPTY_NAMESPACE, t[0], value)
1.48 break
1.49