""" get urls from file_dict and download contextual files from google """
download_urls = {}
download_urls['text'] = file_dict[u'exportLinks']['text/plain']
+
if extension.lower() in ['.ppt', 'pptx']:
download_urls['pdf'] = file_dict[u'exportLinks']['application/pdf']
else:
name = models.CharField(max_length=255, blank=True, null=True)
slug = models.SlugField(max_length=255, null=True)
- year = models.IntegerField(blank=True, null=True,
+ year = models.IntegerField(blank=True, null=True,
default=datetime.datetime.utcnow().year)
desc = models.TextField(max_length=511, blank=True, null=True)
uploaded_at = models.DateTimeField(null=True, default=datetime.datetime.utcnow)
return u"/{0}/{1}/{2}".format(self.course.school.slug, self.course.slug, self.id)
def sanitize_html(self, save=True):
- """ if self contains html, find all <a> tags and add target=_blank
+ """ if self contains html, find all <a> tags and add target=_blank
takes self
returns True/False on succ/fail and error or count
"""