1 # Copyright 2007 Sam Hart
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 Contains all of the data objects defined and used by Swarm.
25 #from sqlalchemy.orm import mapper, relation, backref
27 #import swarmlib.db.schema as schema
30 def __init__(self, hash_id, short_hash_id):
31 self.issue_id = short_hash_id
32 self.hash_id = hash_id
34 return "<Issue('%s', '%s')>" % (self.hash_id, self.short_hash_id)
37 def __init__(self, hash_id, summary):
38 self.hash_id = hash_id
39 self.summary = summary
41 return "<Node('%s', '%s')>" % (self.hash_id, self.summary)
43 class TransactionEntry(object):
44 def __init__(self, root, time, transaction, transaction_data):
47 self.transaction = transaction
48 self.transaction_log = transaction_log
51 return "<TransactionEntry(root:'%s', time:'%s'>" % (self.root,
54 class ComponentEntry(object):
55 def __init__(self, name, isdefault=False):
57 self.isdefault = isdefault
60 return "<ComponentEntry('%s', default:'%s')>" % (self.name,
63 class VersionEntry(object):
64 def __init__(self, name, isdefault=False):
66 self.isdefault = isdefault
69 return "<VersionEntry('%s', default:'%s')>" % (self.name,
72 class MilestoneEntry(object):
73 def __init__(self, name, isdefault=False):
75 self.isdefault = isdefault
78 return "<MilestoneEntry('%s', default:'%s')>" % (self.name,
81 class SeverityEntry(object):
82 def __init__(self, name, isdefault=False):
84 self.isdefault = isdefault
87 return "<SeverityEntry('%s', default:'%s')>" % (self.name,
90 class PriorityEntry(object):
91 def __init__(self, name, isdefault=False):
93 self.isdefault = isdefault
96 return "<PriorityEntry('%s', default:'%s')>" % (self.name,
99 class StatusEntry(object):
100 def __init__(self, name, isdefault=False):
102 self.isdefault = isdefault
105 return "<StatusEntry('%s', default:'%s')>" % (self.name,
108 class ResolutionEntry(object):
109 def __init__(self, name, isdefault=False):
111 self.isdefault = isdefault
114 return "<ResolutionEntry('%s', default:'%s')>" % (self.name,
117 class Upstream(object):
118 def __init__(self, uri, upstream_type, authentication, transport):
120 self.upstream_type = upstream_type
121 self.authentication = authentication
122 self.transport = transport
125 return "<Upstream('%s')>" % self.uri