query.exec_("""CREATE TABLE calls (
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,
caller VARCHAR(40) NOT NULL,
starttime DATETIME NOT NULL,
endtime DATETIME NOT NULL,
random_new_field VARCHAR(80) NOT NULL,
topic VARCHAR(80) NOT NULL)""")
topics = ("Complaint", "Information request", "Off topic",
"Information supplied", "Complaint", "Complaint")
print "Populating table..."
query.prepare("INSERT INTO calls (caller, starttime, endtime, "
"topic) VALUES (?, ?, ?, ?)")
for name in ('Joshan Cockerall', 'Ammanie Ingham',
'Diarmuid Bettington', 'Juliana Bannister',
'Oakley-Jay Buxton', 'Reilley Collinge',
'Ellis-James Mcgehee', 'Jazmin Lawton',
'Lily-Grace Smythe', 'Coskun Lant', 'Lauran Lanham',
'Millar Poindexter', 'Naqeeb Neild', 'Maxlee Stoddart',
'Rebia Luscombe', 'Briana Christine', 'Charli Pease',
'Deena Mais', 'Havia Huffman', 'Ethan Davie',
'Thomas-Jack Silver', 'Harpret Bray', 'Leigh-Ann Goodliff',
'Seoras Bayes', 'Jenna Underhill', 'Veena Helps',
'Mahad Mcintosh', 'Allie Hazlehurst', 'Aoife Warrington',
'Cameron Burton', 'Yildirim Ahlberg', 'Alissa Clayton',
'Josephine Weber', 'Fiore Govan', 'Howard Ragsdale',
'Tiernan Larkins', 'Seren Sweeny', 'Arisha Keys',
'Kiki Wearing', 'Kyran Ponsonby', 'Diannon Pepper',
'Mari Foston', 'Sunil Manson', 'Donald Wykes',
'Rosie Higham', 'Karmin Raines', 'Tayyibah Leathem',
'Kara-jay Knoll', 'Shail Dalgleish', 'Jaimie Sells'):
start = now.addDays(-random.randint(1, 30))
start = now.addSecs(-random.randint(60 * 5, 60 * 60 * 2))
end = start.addSecs(random.randint(20, 60 * 13))
topic = random.choice(topics)
query.exec_()
query.exec_("""CREATE TABLE calls (
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,
caller VARCHAR(40) NOT NULL,
starttime DATETIME NOT NULL,
endtime DATETIME NOT NULL,
random_new_field VARCHAR(80) NOT NULL,
topic VARCHAR(80) NOT NULL)""")
topics = ("Complaint", "Information request", "Off topic",
"Information supplied", "Complaint", "Complaint")
now = QDateTime.currentDateTime()
print "Populating table..."
query.prepare("INSERT INTO calls (caller, starttime, endtime, "
"topic) VALUES (?, ?, ?, ?)")
for name in ('Joshan Cockerall', 'Ammanie Ingham',
'Diarmuid Bettington', 'Juliana Bannister',
'Oakley-Jay Buxton', 'Reilley Collinge',
'Ellis-James Mcgehee', 'Jazmin Lawton',
'Lily-Grace Smythe', 'Coskun Lant', 'Lauran Lanham',
'Millar Poindexter', 'Naqeeb Neild', 'Maxlee Stoddart',
'Rebia Luscombe', 'Briana Christine', 'Charli Pease',
'Deena Mais', 'Havia Huffman', 'Ethan Davie',
'Thomas-Jack Silver', 'Harpret Bray', 'Leigh-Ann Goodliff',
'Seoras Bayes', 'Jenna Underhill', 'Veena Helps',
'Mahad Mcintosh', 'Allie Hazlehurst', 'Aoife Warrington',
'Cameron Burton', 'Yildirim Ahlberg', 'Alissa Clayton',
'Josephine Weber', 'Fiore Govan', 'Howard Ragsdale',
'Tiernan Larkins', 'Seren Sweeny', 'Arisha Keys',
'Kiki Wearing', 'Kyran Ponsonby', 'Diannon Pepper',
'Mari Foston', 'Sunil Manson', 'Donald Wykes',
'Rosie Higham', 'Karmin Raines', 'Tayyibah Leathem',
'Kara-jay Knoll', 'Shail Dalgleish', 'Jaimie Sells'):
start = now.addDays(-random.randint(1, 30))
start = now.addSecs(-random.randint(60 * 5, 60 * 60 * 2))
end = start.addSecs(random.randint(20, 60 * 13))
topic = random.choice(topics)
query.addBindValue(QVariant(QString(name)))
query.addBindValue(QVariant(start))
query.addBindValue(QVariant(end))
query.addBindValue(QVariant(QString(topic)))
query.exec_()
QApplication.processEvents()
To copy to clipboard, switch view to plain text mode
query.prepare("INSERT INTO calls (caller, starttime, endtime, random_new_field, "
"topic) VALUES (?, ?, ?, ?, ?)")
for name in ('Joshan Cockerall', 'Ammanie Ingham',
'Diarmuid Bettington', 'Juliana Bannister',
'Oakley-Jay Buxton', 'Reilley Collinge',
'Ellis-James Mcgehee', 'Jazmin Lawton',
'Lily-Grace Smythe', 'Coskun Lant', 'Lauran Lanham',
'Millar Poindexter', 'Naqeeb Neild', 'Maxlee Stoddart',
'Rebia Luscombe', 'Briana Christine', 'Charli Pease',
'Deena Mais', 'Havia Huffman', 'Ethan Davie',
'Thomas-Jack Silver', 'Harpret Bray', 'Leigh-Ann Goodliff',
'Seoras Bayes', 'Jenna Underhill', 'Veena Helps',
'Mahad Mcintosh', 'Allie Hazlehurst', 'Aoife Warrington',
'Cameron Burton', 'Yildirim Ahlberg', 'Alissa Clayton',
'Josephine Weber', 'Fiore Govan', 'Howard Ragsdale',
'Tiernan Larkins', 'Seren Sweeny', 'Arisha Keys',
'Kiki Wearing', 'Kyran Ponsonby', 'Diannon Pepper',
'Mari Foston', 'Sunil Manson', 'Donald Wykes',
'Rosie Higham', 'Karmin Raines', 'Tayyibah Leathem',
'Kara-jay Knoll', 'Shail Dalgleish', 'Jaimie Sells'):
start = now.addDays(-random.randint(1, 30))
start = now.addSecs(-random.randint(60 * 5, 60 * 60 * 2))
end = start.addSecs(random.randint(20, 60 * 13))
topic = random.choice(topics)
random_new_field = ""
query.exec_()
query.prepare("INSERT INTO calls (caller, starttime, endtime, random_new_field, "
"topic) VALUES (?, ?, ?, ?, ?)")
for name in ('Joshan Cockerall', 'Ammanie Ingham',
'Diarmuid Bettington', 'Juliana Bannister',
'Oakley-Jay Buxton', 'Reilley Collinge',
'Ellis-James Mcgehee', 'Jazmin Lawton',
'Lily-Grace Smythe', 'Coskun Lant', 'Lauran Lanham',
'Millar Poindexter', 'Naqeeb Neild', 'Maxlee Stoddart',
'Rebia Luscombe', 'Briana Christine', 'Charli Pease',
'Deena Mais', 'Havia Huffman', 'Ethan Davie',
'Thomas-Jack Silver', 'Harpret Bray', 'Leigh-Ann Goodliff',
'Seoras Bayes', 'Jenna Underhill', 'Veena Helps',
'Mahad Mcintosh', 'Allie Hazlehurst', 'Aoife Warrington',
'Cameron Burton', 'Yildirim Ahlberg', 'Alissa Clayton',
'Josephine Weber', 'Fiore Govan', 'Howard Ragsdale',
'Tiernan Larkins', 'Seren Sweeny', 'Arisha Keys',
'Kiki Wearing', 'Kyran Ponsonby', 'Diannon Pepper',
'Mari Foston', 'Sunil Manson', 'Donald Wykes',
'Rosie Higham', 'Karmin Raines', 'Tayyibah Leathem',
'Kara-jay Knoll', 'Shail Dalgleish', 'Jaimie Sells'):
start = now.addDays(-random.randint(1, 30))
start = now.addSecs(-random.randint(60 * 5, 60 * 60 * 2))
end = start.addSecs(random.randint(20, 60 * 13))
topic = random.choice(topics)
random_new_field = ""
query.addBindValue(QVariant(QString(name)))
query.addBindValue(QVariant(start))
query.addBindValue(QVariant(end))
query.addBindValue(QVariant(QString(random_new_field)))
query.addBindValue(QVariant(QString(topic)))
query.exec_()
QApplication.processEvents()
To copy to clipboard, switch view to plain text mode
Bookmarks