fix broken publishing\
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 22 Dec 2011 12:25:26 +0000 (13:25 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 22 Dec 2011 12:25:26 +0000 (13:25 +0100)
apps/api/tests.py
apps/picture/models.py
lib/librarian

index 74417ac..5a981a2 100644 (file)
@@ -10,9 +10,10 @@ from api.helpers import timestamp
 from catalogue.models import Book, Tag
 from picture.tests.utils import RequestFactory
 from picture.forms import PictureImportForm
 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
 import picture.tests
 from django.core.files.uploadedfile import SimpleUploadedFile
+
  
 from os import path
 
  
 from os import path
 
@@ -160,3 +161,4 @@ class PictureTests(ApiTest):
             import_form.save()
 
         pic = Picture.objects.get(slug=slug)
             import_form.save()
 
         pic = Picture.objects.get(slug=slug)
+
index 3cb1d89..8aa6f97 100644 (file)
@@ -80,7 +80,7 @@ class Picture(models.Model):
         """
         from sortify import sortify
         from django.core.files import File
         """
         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):
         close_xml_file = False
         close_image_file = False
         # class SimpleImageStore(object):
@@ -98,7 +98,8 @@ class Picture(models.Model):
 
         try:
             # use librarian to parse meta-data
 
         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)
                     # image_store=SimpleImageStore
 
             picture, created = Picture.objects.get_or_create(slug=picture_xml.slug)
index ef1261d..5fed788 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ef1261dbe0b30a1ab9f39831b7c167918913338a
+Subproject commit 5fed78856949474a36bc5e268517775a9a802e27