From: Guillaume Pellerin Date: Tue, 10 Feb 2015 13:18:09 +0000 (+0100) Subject: Add various annotation mime types X-Git-Tag: 1.5.1~1^2~17 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4e6c2604dbd773af1c40eef13c96d84d2cd77c48;p=telemeta.git Add various annotation mime types --- diff --git a/telemeta/models/core.py b/telemeta/models/core.py index 9767aa56..e20b754a 100644 --- a/telemeta/models/core.py +++ b/telemeta/models/core.py @@ -63,16 +63,22 @@ from xml.dom.minidom import getDOMImplementation PUBLIC_ACCESS_CHOICES = (('none', _('none')), ('metadata', _('metadata')), ('mixed', _('mixed')), ('full', _('full'))) -mimetypes.add_type('video/webm','.webm') -mimetypes.add_type("text/xml", ".eaf") +extra_types = { + '.webm': 'video/webm', + '.eaf': 'text/xml', # ELAN Annotation Format + '.trs': 'text/xml', # Trancriber Annotation Format + '.svl': 'text/xml', # Sonic Visualiser layer file + '.TextGrid': 'text/praat-textgrid', # Praat TextGrid annotation file +} + +for ext,mime_type in extra_types.items(): + mimetypes.add_type(mime_type, ext) app_name = 'telemeta' strict_code = getattr(settings, 'TELEMETA_STRICT_CODE', False) - - class EnhancedQuerySet(models.query.QuerySet): """QuerySet with added functionalities such as WeakForeignKey handling"""