Skip to content

Commit

Permalink
table Times: nemeni se user pri zmene cisla. Closes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
meloun committed Mar 22, 2011
1 parent 5c657ce commit 73641ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Binary file modified db/test_db.sqlite
Binary file not shown.
27 changes: 13 additions & 14 deletions ewitis/gui/myModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,24 @@ def slot_ModelChanged(self, item):

#user change, no auto update
if((self.params.guidata.mode == GuiData.MODE_EDIT) and (self.params.guidata.user_actions == GuiData.ACTIONS_ENABLE)):

#virtual function
#get dictionary with row-data, ready for DB
tabRow = self.getRow(item.row())


#get dictionary with row-data, ready for DB
tabRow = self.getRow(item.row())

#dbRow <- tableRow
dbRow = self.table2dbRow(tabRow)

#is there
#exist row?
if (dbRow != None):
#replace
#try:
self.params.db.update_from_dict(self.params.name, dbRow)
#except:
# self.params.showmessage(self.params.name+" Update", "Error!")
return

self.update()
#update DB
try:
self.params.db.update_from_dict(self.params.name, dbRow)
except:
self.params.showmessage(self.params.name+" Update", "Error!")
return

#update model
self.update()


def getDefaultTableRow(self):
Expand Down

0 comments on commit 73641ab

Please sign in to comment.