Commit c2b7ff0c authored by gijs's avatar gijs

Move images to filer

parent bff38f79
......@@ -19,14 +19,14 @@ class Command(BaseCommand):
with open(filepath, "rb") as f:
print(contourImage.image, contourImage.image.file, filepath)
# file_obj = File(f, name=filename)
# filerImage = FilerImage.objects.create(
# owner=user,
# original_filename=filename,
# file=file_obj)
# # print(filerImage, filerImage.file)
# # filerImage.save()
# contourImage.filerImage = filerImage
# print(contourImage.save())
file_obj = File(f, name=filename)
filerImage = FilerImage.objects.create(
owner=user,
original_filename=filename,
file=file_obj)
# print(filerImage, filerImage.file)
# filerImage.save()
contourImage.filerImage = filerImage
print(contourImage.save())
# except:
# pass
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment