[Zope-CVS] CVS: Packages/JobBoardEx - JobView.py:1.2

Guido van Rossum guido@python.org
Thu, 21 Mar 2002 11:50:23 -0500


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

Modified Files:
	JobView.py 
Log Message:
Lose boilerplate.  Don't inherit from ContextDependent.


=== Packages/JobBoardEx/JobView.py 1.1 => 1.2 ===
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-# 
-##############################################################################
-"""
+from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
 
-Revision information: $Id$
-"""
 
-import os
+class JobView(AttributePublisher):
 
-from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
-from Zope.ComponentArchitecture.ContextDependent import ContextDependent
+    def __init__(self, job):
+        self.job = job
 
+    def getContext(self):
+        return self.job
 
-class JobView(AttributePublisher, ContextDependent):
     index = PageTemplateFile('EndUserJobDisplay.pt')
 
     simpleView = PageTemplateFile('JobView.pt')
@@ -33,13 +20,13 @@
     # Add accessor methods so the security framework can do assertion.  The
     # page template can't use the attributes on the Job object directly. :(
     def getSubmitter(self):
-        return self.getContext().submitter
+        return self.job.submitter
 
     def getSummary(self):
-        return self.getContext().summary
+        return self.job.summary
 
     def getDescription(self):
-        return self.getContext().description
+        return self.job.description
 
     def getContact(self):
-        return self.getContext().contact
+        return self.job.contact