|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
from aldryn_search.views import AldrynSearchView
|
|
|
|
|
from cms.models import Page
|
|
|
|
|
from django.core.urlresolvers import reverse_lazy
|
|
|
|
|
from django.views import View
|
|
|
|
|
from django.views.generic import RedirectView
|
|
|
|
|
from django.views.generic.edit import FormView
|
|
|
|
|
from aldryn_forms.admin.views import FormExportWizardView
|
|
|
|
|
@ -9,6 +10,8 @@ from aldryn_forms.admin.exporter import Exporter
|
|
|
|
|
from tablib import Dataset
|
|
|
|
|
from django.http import HttpResponse
|
|
|
|
|
from project.forms import NewsletterSubscriptionForm
|
|
|
|
|
import os
|
|
|
|
|
import zipfile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SearchView(AldrynSearchView):
|
|
|
|
|
@ -102,3 +105,14 @@ class CustomFormExportWizardView(FormExportWizardView):
|
|
|
|
|
response = HttpResponse(dataset.xls, content_type=content_type)
|
|
|
|
|
response['Content-Disposition'] = 'attachment; filename=%s' % filename
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ArchiveFilerPublic(View):
|
|
|
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
|
with zipfile.ZipFile('filer_public.zip', 'w', zipfile.ZIP_DEFLATED) as zipf:
|
|
|
|
|
for root, dirs, files in os.walk('/var/www/tagesschule/docker/storage/filer_public/'):
|
|
|
|
|
for file in files:
|
|
|
|
|
ziph.write(os.path.join(root, file), os.path.relpath(os.path.join(root, file), os.path.join(path, '..')))
|
|
|
|
|
return HttpResponse('success')
|
|
|
|
|
|
|
|
|
|
|