[Zope-CVS] CVS: Packages/JobBoardEx - IJob.py:1.1 Job.py:1.1

Fred L. Drake, Jr. fdrake@acm.org
Tue, 19 Mar 2002 17:47:13 -0500


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

Added Files:
	IJob.py Job.py 
Log Message:
Basic Job object.

=== Added File Packages/JobBoardEx/IJob.py ===
"""
IJob.py
"""


from Interface import Interface

class IJob(Interface):
    """Interface for the basic Job"""

    def getSubmitter():
        "Gets the email address of the submitter"

    def getSummary():
        "Gets the one-line summary of the job"

    def getDescription():
        "Gets the multiline description of the job"

    def getContactURL():
        "Gets the URL where the job seeker can go"

    def getContactEmail():
        "Gets the email address the job seeker may send to"

    def getState():
        "Gets the JobState object describing the current state of this listing"

    def approve(self):
        "Moves the job state to approved"

class JobState:
    PendingApproval = 1
    Approved = 2



=== Added File Packages/JobBoardEx/Job.py ===
"""
Job.py
"""

from IJob import IJob, JobState
from Persistence import Persistent


class Job(Persistent):
    __implements__ = IJob,

    def __init__(self, submitter, summary, description,
                 contactURL, contactEmail):
        self.submitter = submitter
        self.summary = summary
        self.description = description
        self.contactURL = contactURL
        self.contactEmail = contactEmail
        self.jobState = JobState.PendingApproval

    def getSubmitter(self):
        "Gets the email address of the submitter"
        return self.submitter

    def getSummary(self):
        "Gets the one-line summary of the job"
        return self.summary

    def getDescription(self):
        "Gets the multiline description of the job"
        return self.description

    def getContactURL(self):
        "Gets the URL where the job seeker can go"
        return self.contactURL

    def getContactEmail(self):
        "Gets the email address the job seeker may send to"
        return self.contactEmail

    def getState(self):
        "Gets the JobState object describing the current state of this listing"
        return self.jobState

    def approve(self):
        "Moves the job state to approved"
        self.jobState = JobState.Approved