I have not tested this code, but I can just guide you where to start. I would suggest you write the unzip code in the model save function. This is the easiest way, but not the best. A Django admin can handle multiple forms as a django admin setting.
I hope your models are somewhat similar to these
from django.db import models
from django.core.files.storage import FileSystemStorage
fs = FileSystemStorage(location="/var/www/yoursite/private/")
class SetOfFiles(models.Model):
name = models.CharField('set name'), max_length=225, null=False, blank=False)
class File(models.Model):
set = models.ForeignKey(SetOfFiles, verbose_name=_('set'))
file = models.FileField(storage=fs)
def save(self, *args, **kwargs):
if not self.id:
... unzip your file ...
... encrypt your file if necessary ...
super(File, self).save(*args, **kwargs)
Create admin.py in the appropriate application, setting up an administrator to handle multiple inserts:
from django.contrib import admin
class FileInline(admin.TabularInline):
model = File
class SetOfFilesAdmin(admin.ModelAdmin):
list_display = ('name',)
inlines = [FileInline]
admin.site.register(SetOfFiles, SetOfFilesAdmin)
ZIP , FileBrowser, - FileBrowser. zipfile python module.
PyCrypto AES.