From: Radek Czajka Date: Mon, 18 Feb 2013 12:25:41 +0000 (+0100) Subject: add materials to lesson pack X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/bab28a58fcd4c7df766d69b9c34d14122af75165?hp=abd66021256d14b8d3ac7a09d9673f5c0b7cc174 add materials to lesson pack --- diff --git a/catalogue/models.py b/catalogue/models.py index d052d67..c684ab5 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -180,6 +180,10 @@ class Lesson(models.Model): if pdf: zipf.write(pdf.path, "%s%s%s.pdf" % (prefix, self.slug, "_student" if student else "")) + for attachment in self.attachment_set.all(): + zipf.write(attachment.file.path, + u"%smaterialy/%s.%s" % (prefix, attachment.slug, attachment.ext)) + def build_package(self, student=False):