Yet more audit work

This commit is contained in:
Tim Bentley 2009-10-26 05:36:19 +00:00
parent 3f69bb7635
commit 9569042275
2 changed files with 11 additions and 6 deletions

View File

@ -21,6 +21,7 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
@ -97,10 +98,6 @@ class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog):
self.ThirdToTimeEdit.setEnabled(True) self.ThirdToTimeEdit.setEnabled(True)
def accept(self): def accept(self):
print self.DetailedReport.isChecked()
print self.SummaryReport.isChecked()
print self.FromDateEdit.date()
print self.ToDateEdit.date()
if self.DetailedReport.isChecked(): if self.DetailedReport.isChecked():
self.detailedReport() self.detailedReport()
else: else:
@ -112,7 +109,15 @@ class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog):
filename = u'audit_det_%s_%s.txt' % \ filename = u'audit_det_%s_%s.txt' % \
(self.FromDateEdit.date().toString(u'ddMMyyyy'), (self.FromDateEdit.date().toString(u'ddMMyyyy'),
self.ToDateEdit.date().toString(u'ddMMyyyy')) self.ToDateEdit.date().toString(u'ddMMyyyy'))
print filename audits = self.parent.auditmanager.get_all_audits()
outname = os.path.join(unicode(self.FileLineEdit.text()), filename)
file = open(outname, u'w')
for audit in audits:
record = u'\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n' % \
(audit.auditdate,audit.audittime, audit.title,
audit.copyright, audit.ccl_number , audit.authors)
file.write(record)
file.close()
def summaryReport(self): def summaryReport(self):
print "summary" print "summary"

View File

@ -63,7 +63,7 @@ class AuditManager():
""" """
Returns the details of a audit Returns the details of a audit
""" """
return self.session.query(AuditItem).order_by(AuditItem.title).all() return self.session.query(AuditItem).order_by(AuditItem.auditdate, AuditItem.audittime ).all()
def insert_audit(self, audititem): def insert_audit(self, audititem):
""" """