fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix broken publishing\
[wolnelektury.git]
/
apps
/
picture
/
models.py
diff --git
a/apps/picture/models.py
b/apps/picture/models.py
index
3cb1d89
..
8aa6f97
100644
(file)
--- a/
apps/picture/models.py
+++ b/
apps/picture/models.py
@@
-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)