.
This commit is contained in:
+5
-4
@@ -170,7 +170,8 @@ class Long(models.Model):
|
||||
q = get_object_or_404(Long, pk=question_id)
|
||||
|
||||
#exam_order.append(q.id)
|
||||
path= "{0}longs/questions/{1}".format(settings.MEDIA_ROOT, question_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)
|
||||
with open(path, "w+") as f:
|
||||
# Loop through longimage associations
|
||||
f.write("[")
|
||||
@@ -185,10 +186,10 @@ class Long(models.Model):
|
||||
# #image_array.append(i.image.url)
|
||||
|
||||
# We are still limited by the size of a series (although this should not be too big or computers will crash...)
|
||||
#image_array = [image_as_base64(i.image) for i in series.images.all()]
|
||||
image_array = [i.image.url for i in series.images.all()]
|
||||
image_array = [image_as_base64(i.image) for i in series.images.all()]
|
||||
#image_array = [i.image.url for i in series.images.all()]
|
||||
f.write(json.dumps(image_array))
|
||||
#images.append(image_array)
|
||||
images.append(url)
|
||||
if i != len(question_series) - 1:
|
||||
f.write(",")
|
||||
image_titles.append(series.get_examination())
|
||||
|
||||
Reference in New Issue
Block a user