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

Jeremy Hylton jeremy@zope.com
Tue, 19 Mar 2002 16:26:28 -0500


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

Added Files:
	JobList.py 
Log Message:
Add JobList container.


=== Added File Packages/JobBoardEx/JobList.py ===
from Persistence import Persistent, PersistentList

class JobList(Persistent):

    def __init__(self):
        self.jobs = PersistentList()

    def add(self, job):
        self.jobs.append(job)

    def remove(self, job):
        self.jobs.remove(job)

    def query(self, state):
        return [job for job in self.jobs
                if job.state == state]