Thanks,
but it doesn't work for me ( I try locally )
And I can't modify this file for my production server.
Here is my code with gallery upload support:
file : models.py
import unicodedata
line 75:
else:
def get_storage_path(instance, filename):
safefilename = unicodedata.normalize('NFKD',
unicode(filename)).encode('ascii', 'ignore')
return os.path.join(PHOTOLOGUE_DIR, 'photos', safefilename)
def get_zip_tmp_path(instance,filename):
safefilename = unicodedata.normalize('NFKD',
filename).encode('ascii', 'ignore')
return os.path.join(PHOTOLOGUE_DIR, 'temp', safefilename)
line 182:
class GalleryUpload(models.Model):
zip_file = models.FileField(_('images file (.zip)'),
upload_to=get_zip_tmp_path,
By the way I found that you raise an error if the gallery upload name
already exist in gallery name, here a solution :
def process_zipfile(self):
if os.path.isfile(self.zip_file.path):
# TODO: implement try-except here
zip = zipfile.ZipFile(self.zip_file.path)
bad_file = zip.testzip()
if bad_file:
raise Exception('"%s" in the .zip archive is corrupt.'
% bad_file)
count = 1
if self.gallery:
gallery = self.gallery
else:
----> Search = Gallery.objects.filter(title =self.title)
----> if Search.count() > 0:
----> safetitle = '_'.join([self.title,str(Search.count()
+1)])
----> else:
----> safetitle = self.title
----> gallery = Gallery.objects.create(title=safetitle,
---->
title_slug=slugify(safetitle),
description=self.description,
is_public=self.is_public,
tags=self.tags)
On 2 mar, 23:46, Aljosa Mohorovic <
aljosa.mohoro...@gmail.com> wrote:
> probably a problem with apache configuration, try this:
http://groups.google.com/group/modwsgi/browse_thread/thread/a5be1657d...
>
> Aljosa Mohorovic