This commit is contained in:
Ross
2021-03-11 14:07:36 +00:00
parent 926f5e1d6d
commit ccd72e987d
+4 -2
View File
@@ -175,6 +175,8 @@ class Long(models.Model):
#exam_order.append(q.id)
path= "{0}longs/questions/{1}.json".format(settings.MEDIA_ROOT, question_id)
url= "{0}longs/questions/{1}.json".format(settings.MEDIA_URL, question_id)
timestamp = datetime.datetime.now()
with open(path, "w+") as f:
# We manually create the json for long questions to reducem memroy usade
@@ -182,7 +184,7 @@ class Long(models.Model):
"title": "{}",
"type": "long",
"generated": "{}",
""".format(q.history, datetime.datetime.now().isoformat())
""".format(q.history, timestamp.isoformat())
)
@@ -211,7 +213,7 @@ class Long(models.Model):
f.write('"image_titles" : {} }}'.format(json.dumps(image_titles)))
self.json_creation_time = datetime.datetime.now()
self.json_creation_time = timestamp
self.save()
#exam_question = {