class PageCommit(QWizardPage):
def __init__(self, parent=None, db=None):
+ """Set up widgets and message to have picture taken."""
QWizardPage.__init__(self,parent)
self.db = db
self.instructions = QLabel("You're done with the computer. Go have your picture taken.\n\nThe SAs/PAs will add the photo to your data.")
self.setSubTitle("Photo")
def initializePage(self):
+ """Add data collected from previous pages to database."""
q = QSqlQuery(self.db)
q.prepare("INSERT INTO people (netid, forename, surname, email, birthday, phone, major, dorm, room, createtime, mtime )"
"VALUES (:netid, :forename, :surname, :email, :birthday, :phone, :major, :dorm, :room, :createtime, :mtime )" );
q.bindValue(":forename", self.field("forename") )
q.bindValue(":surname", self.field("surname") )
q.bindValue(":email", self.field("email") )
- y = self.field("year").toInt()[0] + 1987
+ y = self.field("year").toInt()[0] + 1983
m = self.field("month").toInt()[0] + 1
d = self.field("day").toInt()[0] + 1
bday = QDate(y,m,d)
q.bindValue(":birthday", QVariant(bday.toString(Qt.ISODate)) )
q.bindValue(":phone", self.field("phone") )
q.bindValue(":major", self.field("major") )
- q.bindValue(":dorm", self.field("dorm") )
+ q.bindValue(":dorm", QVariant(QString(["","Clements","Lechner","McFadden"][self.field("dorm").toInt()[0]])) )
q.bindValue(":room", self.field("room") )
q.bindValue(":createtime", QVariant(QDateTime.currentDateTime().toString(Qt.ISODate)) )
q.bindValue(":mtime", QVariant(QDateTime.currentDateTime().toString(Qt.ISODate)) )