Files
YMS/yms/model/task.py
T

27 lines
695 B
Python

# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Task(DbRecord):
table = "task"
pk_field = "taskid"
pk_is_auto = True
fields = ('taskid', 'vid', 'projid', 'taskname', 'priority',
'taskstate', 'state_ts', 'plandate', 'duedate', 'started', 'finished',
'responsible', 'remarks')
def __init__(self, db, taskid=None):
super().__init__(db, taskid)
self.title = _("Task({})")
def save(self, commit=True):
if not super().save():
return False
if commit:
try:
self.conn.commit()
except mariadb.Error as e:
return False
return True