[Zope-CVS] CVS: Packages/JobBoardEx/Views/Browser - NewJob.py:1.4

Jeremy Hylton jeremy@zope.com
Wed, 20 Mar 2002 15:00:38 -0500


Update of /cvs-repository/Packages/JobBoardEx/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv29495/Views/Browser

Modified Files:
	NewJob.py 
Log Message:
Fixup NewJob enough to get the Preview button working.




=== Packages/JobBoardEx/Views/Browser/NewJob.py 1.3 => 1.4 ===
 from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
 from Zope.ComponentArchitecture.ContextDependent import ContextDependent
-from Zope.ComponentArchitecture import getView
+from Zope.ComponentArchitecture import getRequestView
 
 from ZopeProducts.JobBoardEx.Job import Job
 
@@ -30,10 +30,17 @@
 
     waiting = PageTemplateFile('Waiting.pt')
 
-    def getJobView(self, submitter, summary, description, contact, REQUEST):
-        job = Job(submitter, summary, description, '', contact)
-        view = getRequestView(job, 'JobView', REQUEST)
-        return view.simpleView(REQUEST)
+    def setViewRequest(self, request):
+        self.request = request
+        self.job = Job(request['submitter'],
+                       request['summary'],
+                       request['description'],
+                       '',
+                       request['contact'])
+
+    def getJobView(self):
+        view = getRequestView(self.job, 'JobView', self.request)
+        return view.simpleView(self.request)
 
     def cancel(self, REQUEST):
         # XXX This redirect will change