Fixes for webgui and more native gui development
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ class Box(DbRecord):
|
||||
table = "box"
|
||||
pk_field = "boxid"
|
||||
fields = ('boxid', 'sid', 'boxtype', 'parent', 'label', 'color', 'content',
|
||||
'weight', 'remarks')
|
||||
'wx', 'wy', 'wz', 'weight', 'weight_net', 'price', 'remarks')
|
||||
|
||||
def __init__(self, db, boxid=None):
|
||||
super().__init__(db, boxid)
|
||||
|
||||
+11
-1
@@ -22,14 +22,24 @@ class Vessel(DbRecord):
|
||||
"WHERE v1.vid>=0 AND v2.vid IS NULL"
|
||||
)
|
||||
self.dcur.execute(sql)
|
||||
row = self.cur.fetchone()
|
||||
row = self.dcur.fetchone()
|
||||
if row is None:
|
||||
# vessel table empty: create first vessel
|
||||
self.pk_value = 1
|
||||
else:
|
||||
# create additional vessel
|
||||
self.pk_value = row['newid']
|
||||
self.clear()
|
||||
self.vid = self.pk_value
|
||||
self.vesselname = f"Vessel #{self.pk_value}"
|
||||
self.vtype = 1 # monohull
|
||||
self._insert()
|
||||
self.conn.commit()
|
||||
|
||||
def save(self):
|
||||
super().save()
|
||||
self.conn.commit()
|
||||
|
||||
def delete(self):
|
||||
# there must be no assiciated data!
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user