From bab28a58fcd4c7df766d69b9c34d14122af75165 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 18 Feb 2013 13:25:41 +0100 Subject: [PATCH 1/1] add materials to lesson pack --- catalogue/models.py | 4 ++++ 1 file changed, 4 insertions(+) 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): -- 2.20.1