[Zope-CVS] CVS: Packages/JobBoardEx - ApproveJobs.pt:1.4 ApproveJobs.py:1.5 JobList.zcml:1.11

Guido van Rossum guido@python.org
Mon, 25 Mar 2002 17:54:01 -0500


Update of /cvs-repository/Packages/JobBoardEx
In directory cvs.zope.org:/tmp/cvs-serv22117

Modified Files:
	ApproveJobs.pt ApproveJobs.py JobList.zcml 
Log Message:
Don't use python: expressions for things you can do using TALES.  This
required adding a getPendingJobs() method to the ApproveJobs view.



=== Packages/JobBoardEx/ApproveJobs.pt 1.3 => 1.4 ===
     <tr><th>Defer</th><th>Approve</th><th>Discard</th>
     </tr>
-    <tr tal:repeat="job python:here.query('pending approval')"
+    <tr tal:repeat="job container/getPendingJobs"
 	style="text-align:center">
 	<td><input name="job_N" type="radio" value="defer" checked
-		   tal:attributes="name python:'job_%s' % job.id"></td>
+		   tal:attributes="name string:job_${job/id}"></td>
 	<td><input name="job_N" type="radio" value="approve"
-		   tal:attributes="name python:'job_%s' % job.id"></td>
+		   tal:attributes="name string:job_${job/id}"></td>
 	<td><input name="job_N" type="radio" value="discard"
-		   tal:attributes="name python:'job_%s' % job.id"></td>
+		   tal:attributes="name string:job_${job/id}"></td>
 	<td tal:content="job/summary">The best job on the Internet</td>
     </tr>
     <tr><td colspan="3">


=== Packages/JobBoardEx/ApproveJobs.py 1.4 => 1.5 ===
                 pass
         return self.index(REQUEST)
+
+    def getPendingJobs(self):
+        return self.joblist.query(JobState.PendingApproval)


=== Packages/JobBoardEx/JobList.zcml 1.10 => 1.11 ===
 	name=".JobBoardEx.ApproveJobs."
 	permission_id="Zope.View"
-	methods="index, back, submit"
+	methods="index, back, submit, getPendingJobs"
 />
 
 </zopeConfigure>