# HG changeset patch # User paulb # Date 1201997622 0 # Node ID 972ceefc7dfcbb5a18a9953c656460fc004ea587 # Parent ee57d72c174b6c77cc5f263b3f85bab1c37405a0 [project @ 2008-02-03 00:13:42 by paulb] Made the set_document method work in both the old case and in the new, simplified API case. diff -r ee57d72c174b -r 972ceefc7dfc XSLForms/Fields.py --- a/XSLForms/Fields.py Mon Nov 19 00:19:01 2007 +0000 +++ b/XSLForms/Fields.py Sun Feb 03 00:13:42 2008 +0000 @@ -473,7 +473,9 @@ new_document = new_instance - def set_document(self, name, doc): + # NOTE: Was set_document. + + def _set_document(self, name, doc): """ Store in the container under the given 'name' the supplied document @@ -490,8 +492,13 @@ def get_activity(self): return self.current_activity - def set_document(self, doc): - self.current_document = doc + # NOTE: Signature is flexible to support the older method above. + + def set_document(self, name_or_doc, doc=None): + if doc is not None: + self._set_document(name_or_doc, doc) + else: + self.current_document = name_or_doc def get_document(self): return self.current_document