Files
YMS/yms/model/task.py
T

25 lines
655 B
Python

# SPDX-License-Identifier: WTFPL
from .dbrecord import DbRecord
class Task(DbRecord):
table = "task"
pk_field = "taskid"
fields = ('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