# HG changeset patch # User Daniele Nicolodi # Date 1318622344 -7200 # Node ID aae5891e420d96ef755ce418294623971b7af372 # Parent a4a1b9f582cdc2550e8cfcb1240c7a917d58b65a Assign different submission time to test objects. diff -r a4a1b9f582cd -r aae5891e420d src/ltpdarepo/admin.py --- a/src/ltpdarepo/admin.py Fri Oct 14 11:05:31 2011 +0200 +++ b/src/ltpdarepo/admin.py Fri Oct 14 21:59:04 2011 +0200 @@ -272,8 +272,9 @@ words = re.split('\W+', lorem) sentences = [s + '.' for s in [s.strip() for s in lorem.split('.')] if s] + nsecs = 100 t0 = datetime(1970, 1, 1, 0, 0, 0) - nsecs = 100 + submitted = datetime.utcnow() - timedelta(hours=3 * nobjs) for i in range(nobjs): @@ -284,20 +285,21 @@ curs.execute("""INSERT INTO objs (uuid) VALUES (%s)""", (str(uuid.uuid4()))) objid = curs.lastrowid - curs.execute("""INSERT INTO objmeta (obj_id, obj_type, name, created, - version, ip, hostname, os, submitted, - experiment_title, experiment_desc, analysis_desc, - quantity, additional_authors, additional_comments, - keywords, reference_ids, validated, vdate, author) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, - %s, %s, %s, %s, %s, %s, %s, %s, %s)""", - (objid, 'ao', name, datetime.utcnow(), - '0.1', '127.0.0.1', 'localhost', 'any', datetime.utcnow(), - title, description, analysis, 'FOO', '', '', - 'testing', '', None, None, None)) + curs.execute("""INSERT INTO objmeta ( + obj_id, obj_type, name, created, version, ip, hostname, os, + submitted, experiment_title, experiment_desc, analysis_desc, + quantity, additional_authors, additional_comments, keywords, + reference_ids, validated, vdate, author) + VALUES ( + %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, + %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", + (objid, 'ao', name, datetime.utcnow(), '0.1', '127.0.0.1', 'localhost', 'any', + submitted, title, description, analysis, 'FOO', '', '', 'testing', '', + None, None, None)) curs.execute("""INSERT INTO tsdata (obj_id, fs, t0, nsecs) VALUES (%s, %s, %s, %s)""", (objid, 10, t0, nsecs)) t0 += timedelta(seconds=nsecs) + submitted += timedelta(hours=3) conn.commit() cmd = commands.add(populate)