('doc', 'MS Word compatible file (.doc, .docx, .rtf, .odf)'),
('img', 'Scan or picture of notes'),
('pdf', 'PDF file'),
+ ('ppt', 'Powerpoint'),
(UNKNOWN_FILE, 'Unknown file'),
)
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
""" 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)
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,