Audit database addition insert 2

This commit is contained in:
Tim Bentley 2009-09-23 18:36:22 +01:00
parent 51fb1533bd
commit 39f4cdfcc9
2 changed files with 5 additions and 7 deletions

View File

@ -22,8 +22,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
from datetime import date from datetime import datetime
from time import time
import logging import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
@ -114,14 +113,13 @@ class AuditPlugin(Plugin):
""" """
if self.auditActive: if self.auditActive:
audititem = AuditItem() audititem = AuditItem()
audititem.auditdate = date.today() audititem.auditdate = datetime.today()
a = time.time() audititem.audittime = datetime.now().time()
audititem.audittime = time.time()
audititem.title = auditData[0] audititem.title = auditData[0]
audititem.ccl_id = auditData[2] audititem.ccl_id = auditData[2]
audititem.authors = u'' audititem.authors = u''
for author in auditData[1]: for author in auditData[1]:
audititem.authors = author + u' ' audititem.authors += author + u' '
self.auditmanager.insert_audit(audititem) self.auditmanager.insert_audit(audititem)
def onUpdateAudit(self): def onUpdateAudit(self):

View File

@ -81,7 +81,7 @@ class AuditManager():
return True return True
except: except:
self.session.rollback() self.session.rollback()
log.excertion(u'Audit item failed to save') log.exception(u'Audit item failed to save')
return False return False
def get_audit(self, id=None): def get_audit(self, id=None):