XSLTools

Change of XSLForms/Fields.py

650:972ceefc7dfc
XSLForms/Fields.py
     1.1 --- a/XSLForms/Fields.py	Mon Nov 19 00:19:01 2007 +0000
     1.2 +++ b/XSLForms/Fields.py	Sun Feb 03 00:13:42 2008 +0000
     1.3 @@ -473,7 +473,9 @@
     1.4  
     1.5      new_document = new_instance
     1.6  
     1.7 -    def set_document(self, name, doc):
     1.8 +    # NOTE: Was set_document.
     1.9 +
    1.10 +    def _set_document(self, name, doc):
    1.11  
    1.12          """
    1.13          Store in the container under the given 'name' the supplied document
    1.14 @@ -490,8 +492,13 @@
    1.15      def get_activity(self):
    1.16          return self.current_activity
    1.17  
    1.18 -    def set_document(self, doc):
    1.19 -        self.current_document = doc
    1.20 +    # NOTE: Signature is flexible to support the older method above.
    1.21 +
    1.22 +    def set_document(self, name_or_doc, doc=None):
    1.23 +        if doc is not None:
    1.24 +            self._set_document(name_or_doc, doc)
    1.25 +        else:
    1.26 +            self.current_document = name_or_doc
    1.27  
    1.28      def get_document(self):
    1.29          return self.current_document