from catalogue.models import Book, Tag
from picture.tests.utils import RequestFactory
from picture.forms import PictureImportForm
-from picture.models import Picture
+from picture.models import Picture, picture_storage
import picture.tests
from django.core.files.uploadedfile import SimpleUploadedFile
+
from os import path
import_form.save()
pic = Picture.objects.get(slug=slug)
+
"""
from sortify import sortify
from django.core.files import File
- from librarian.picture import WLPicture
+ from librarian.picture import WLPicture, ImageStore
close_xml_file = False
close_image_file = False
# class SimpleImageStore(object):
try:
# use librarian to parse meta-data
- picture_xml = WLPicture.from_file(xml_file)
+ picture_xml = WLPicture.from_file(xml_file,
+ image_store=ImageStore(picture_storage.path('images')))
# image_store=SimpleImageStore
picture, created = Picture.objects.get_or_create(slug=picture_xml.slug)