Example #1
0
	def __init__(self, id, defaultSprintTab, defaultTasksTab, backlogStyles, messages):
		ActiveRecord.__init__(self)
		self.id = id # Same as the parent user's ID
		self.defaultSprintTab = defaultSprintTab
		self.defaultTasksTab = defaultTasksTab
		self.backlogStyles = backlogStyles
		self.messages = messages
Example #2
0
	def __init__(self, taskid, userid, body, timestamp = None, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.taskid = taskid
		self.userid = userid
		self.body = body
		self.timestamp = timestamp or dateToTs(getNow())
Example #3
0
	def __init__(self, sprintid, name, seq = None, deletable = True, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.sprintid = sprintid
		self.name = name
		self.seq = seq if seq else maxOr(group.seq for group in self.sprint.getGroups()) + 1
		self.deletable = to_bool(deletable)
Example #4
0
	def __init__(self, userid, name, query, public, followerids = None, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.userid = userid
		self.name = name
		self.query = query
		self.public = public
		self.followerids = followerids or set()
Example #5
0
	def __init__(self, projectid, name, ownerid, start, end, memberids = None, flags = None, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.projectid = projectid
		self.name = name
		self.ownerid = ownerid
		self.start = start
		self.end = end
		self.memberids = memberids or set()
		self.flags = flags or set()
Example #6
0
	def __init__(self, userid, senderid, title, body, language = 'html', timestamp = None, read = False, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.userid = userid
		self.senderid = senderid
		self.title = title
		self.body = body
		self.language = language
		self.timestamp = timestamp or dateToTs(getNow())
		self.read = read
Example #7
0
	def __init__(self, groupid, sprintid, creatorid, goalid, name, status, hours, assignedids = None, seq = None, timestamp = None, deleted = False, revision = 1, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.revision = revision
		self.groupid = groupid
		self.sprintid = sprintid
		self.creatorid = creatorid
		self.goalid = goalid
		self.name = name
		self.status = status
		self.hours = hours
		self.assignedids = assignedids or set()
		self.timestamp = timestamp if timestamp else max(dateToTs(getNow()), self.sprint.start)
		self.seq = seq if seq else maxOr(task.seq for task in self.group.getTasks())+1
		self.deleted = deleted
Example #8
0
	def delete(self, deep = True):
		if deep:
			for name in ['Goal', 'Group', 'Task']:
				cls = getattr(import_module(name, name), name)
				cls.deleteAll(sprintid = self.id)
			from Availability import Availability
			Availability(self).wipe()
		return ActiveRecord.delete(self)
Example #9
0
	def save(self):
		if not self.id:
			# Shift everything after this sequence
			for id, group in db()['groups'].iteritems():
				if group['sprintid'] == self.sprintid and group['seq'] >= self.seq:
					with db()['groups'].change(id) as data:
						data['seq'] += 1
		return ActiveRecord.save(self)
Example #10
0
	def __init__(self, type, text, userid = None, ip = None, timestamp = None, location = 0, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.userid = userid
		self.ip = ip
		self.type = type
		self.text = text

		if timestamp:
			self.timestamp = timestamp
		else:
			now = datetime.now() # Use real time, not mocked time through getNow()
			self.timestamp = dateToTs(now) + now.microsecond / 1000000

		if isinstance(location, int):
			filename, line, fn, code = traceback.extract_stack()[-2-location]
			if filename.startswith(basePath()):
				filename = filename[len(basePath())+1:]
			self.location = "%s(%s:%d)" % (fn, filename, line)
		else:
			self.location = location
Example #11
0
	def save(self):
		#DEBUG #NO
		if not isinstance(self.assignedids, (set, frozenset)):
			raise RuntimeError("Broken type (%s)" % type(self.assignedids).__name__)
		if not isinstance(self.assigned, (set, frozenset)):
			raise RuntimeError("Broken type (%s)" % type(self.assigned).__name__)

		if not self.id:
			# Shift everything after this sequence
			for id, task in db()['tasks'].iteritems():
				rev = task[-1]
				if rev['groupid'] == self.groupid and rev['seq'] >= self.seq:
					with db()['tasks'].change(id) as data:
						data[-1]['seq'] += 1
		return ActiveRecord.save(self)
Example #12
0
	def __init__(self, changeid, userid, timestamp = None, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.changeid = changeid
		self.userid = userid
		self.timestamp = timestamp if timestamp else dateToTs(getNow())
Example #13
0
	def __init__(self, catid, body, good, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.catid = catid
		self.body = body
		self.good = good
Example #14
0
	def __init__(self, sprintid, name, id = None):
		ActiveRecord.__init__(self)
		self.id = id
		self.sprintid = sprintid
		self.name = name
Example #15
0
	def delete(self):
		self.move(None)
		return ActiveRecord.delete(self)
Example #16
0
	def save(self):
		if not isinstance(self.followerids, (set, frozenset)):
			raise RuntimeError("Broken type (%s)" % type(self.followerids).__name__)
		if not isinstance(self.followers, (set, frozenset)):
			raise RuntimeError("Broken type (%s)" % type(self.followers).__name__)
		return ActiveRecord.save(self)