1.1 --- a/examples/Common/Candidate/__init__.py Sun Nov 18 17:22:07 2007 +0000
1.2 +++ b/examples/Common/Candidate/__init__.py Sun Nov 18 17:22:24 2007 +0000
1.3 @@ -37,7 +37,7 @@
1.4 self.repository = repository
1.5
1.6 def select_activity(self, trans, form):
1.7 - self.set_activity(trans, "admin")
1.8 + form.set_activity("admin")
1.9
1.10 def create_document(self, trans, form):
1.11 is_new = XSLFormsResource.create_document(self, trans, form)
1.12 @@ -72,7 +72,7 @@
1.13
1.14 def respond_to_document(self, trans, form):
1.15
1.16 - admin = self.get_document(trans)
1.17 + admin = form.get_document()
1.18
1.19 # Synchronise the repository with the CVs found.
1.20
1.21 @@ -97,7 +97,7 @@
1.22 self.repository = repository
1.23
1.24 def select_activity(self, trans, form):
1.25 - self.set_activity(trans, "candidate")
1.26 + form.set_activity("candidate")
1.27
1.28 def create_document(self, trans, form):
1.29 documents = form.get_documents()
1.30 @@ -107,12 +107,12 @@
1.31 # Ensure the presence of a document.
1.32
1.33 if documents.has_key("candidate"):
1.34 - self.set_document(trans, documents["candidate"])
1.35 + form.set_document(documents["candidate"])
1.36 else:
1.37 if self.repository is None or not self.repository.has_key("candidate-%s" % name):
1.38 - self.set_document(trans, form.new_instance("candidate"))
1.39 + form.set_document(form.new_instance("candidate"))
1.40 else:
1.41 - self.set_document(trans, libxml2dom.parseString(self.repository["candidate-%s" % name]))
1.42 + form.set_document(libxml2dom.parseString(self.repository["candidate-%s" % name]))
1.43
1.44 def init_document(self, trans, form):
1.45 status_xml = self.prepare_document("status")
1.46 @@ -160,7 +160,7 @@
1.47
1.48 def respond_to_document(self, trans, form):
1.49
1.50 - candidate = self.get_document(trans)
1.51 + candidate = form.get_document()
1.52 parameters = form.get_parameters()
1.53 fields = trans.get_fields_from_path()
1.54 name = fields.get("name", [u"None"])[0]