making assorted changes for ppt file_type marking on the Note model
authorSeth Woodworth <seth@sethish.com>
Mon, 1 Jul 2013 16:50:00 +0000 (12:50 -0400)
committerSeth Woodworth <seth@sethish.com>
Mon, 1 Jul 2013 16:50:00 +0000 (12:50 -0400)
karmaworld/apps/notes/models.py
karmaworld/apps/notes/views.py

index 0552cc933966c433b750fd50621ccd06aedf945f..768fce704a08777a663a11c24dba0d67818e582e 100644 (file)
@@ -33,6 +33,7 @@ class Note(models.Model):
         ('doc', 'MS Word compatible file (.doc, .docx, .rtf, .odf)'),
         ('img', 'Scan or picture of notes'),
         ('pdf', 'PDF file'),
+        ('ppt', 'Powerpoint'),
         (UNKNOWN_FILE, 'Unknown file'),
     )
 
index 2202a86ff6c0c0205c65c2b108e697a8a3a3372b..e9bffc1578db60b8794c1b0d011032f6be4bb118 100644 (file)
@@ -27,8 +27,7 @@ def is_pdf(self):
     return False
 
 def is_ppt(self):
-    if self.object.pdf_file:
-        print "is a ppt"
+    if self.object.file_type == 'ppt':
         return True
     return False
 
@@ -42,7 +41,7 @@ class NoteDetailView(DetailView):
         """ Generate custom context for the page rendering a Note
             + if pdf, set the `pdf` flag
         """
-        #kwargs['file_url'] = os.path.basename(_path)
+        # not current using these
         #kwargs['hostname'] = Site.objects.get_current()
 
         kwargs['pdf'] = is_pdf(self)
@@ -125,8 +124,6 @@ class PDFView(DetailView):
     def get_context_data(self, **kwargs):
         """ Generate a path to the pdf file associated with this note
             by generating a path to the MEDIA_URL by hand """
-        # FIXME: There may be an undocumented,
-        #   but better way of handling media files in django
 
         if is_ppt:
             kwargs['pdf_path'] = "{0}{1}".format(settings.MEDIA_URL,