Native gui first steps: storage, box and companies are editable
This commit is contained in:
1 parent
1eea4058bf
commit
06a9834688
47 files changed
+3119
-883
No files matched your search
+17
-3
@@ -6,8 +6,8 @@ class Vessel(DbRecord):
|
||||
|
||||
table = "vessel"
|
||||
pk_field = "vid"
|
||||
fields = ('vid', 'vtype', 'vesselname', 'model', 'shipyard', 'loa', 'lwl',
|
||||
'beam', 'draught', 'draught_min', 'displacement', 'ballast',
|
||||
fields = ('vid', 'vtype', 'htype', 'vesselname', 'model', 'shipyard', 'hull_number',
|
||||
'loa', 'lwl', 'beam', 'draught', 'draught_min', 'displacement', 'ballast',
|
||||
'beltpos_aft', 'beltpos_bow', 'shapefile', 'sid_default', 'year_built',
|
||||
'remarks')
|
||||
|
||||
@@ -32,8 +32,15 @@ class Vessel(DbRecord):
|
||||
self.clear()
|
||||
self.vid = self.pk_value
|
||||
self.vesselname = f"Vessel #{self.pk_value}"
|
||||
self.vtype = 1 # monohull
|
||||
self.htype = 'mono'
|
||||
self._insert()
|
||||
# set list change marker
|
||||
sql = (
|
||||
"INSERT INTO revision (revtype, revid, changed) "
|
||||
"VALUES ('table', 1, NOW()) "
|
||||
"ON DUPLICATE KEY UPDATE changed = NOW()"
|
||||
)
|
||||
self.db.cur.execute()
|
||||
self.conn.commit()
|
||||
|
||||
def save(self, commit=True):
|
||||
@@ -44,3 +51,10 @@ class Vessel(DbRecord):
|
||||
def delete(self):
|
||||
# there must be no assiciated data!
|
||||
pass
|
||||
# set list change marker
|
||||
sql = (
|
||||
"INSERT INTO revision (revtype, revid, changed) "
|
||||
"VALUES ('table', 1, NOW()) "
|
||||
"ON DUPLICATE KEY UPDATE changed = NOW()"
|
||||
)
|
||||
self.db.cur.execute()
|
||||
Reference in new issue
Block a user