26 lines
681 B
Python
26 lines
681 B
Python
# SPDX-License-Identifier: WTFPL
|
|
|
|
from .dbrecord import DbRecord
|
|
from yms.lookup import Table
|
|
|
|
class Project(DbRecord):
|
|
|
|
table = "project"
|
|
pk_field = "projid"
|
|
fields = ('projname', 'vid', 'responsible', 'startdate', 'duration',
|
|
'costs_plan', 'costs_final', 'remarks', 'projstate')
|
|
|
|
def __init__(self, db, projid=None):
|
|
super().__init__(db, projid)
|
|
self.title = _("Project({})")
|
|
|
|
def save(self, commit=True):
|
|
if not super().save(Table.PROJECTS):
|
|
return False
|
|
if commit:
|
|
try:
|
|
self.conn.commit()
|
|
except mariadb.Error as e:
|
|
return False
|
|
return True
|