+ FileFormat = namedtuple("FileFormat", "name ext")
+ formats = SortedDict([
+ ('mp3', FileFormat(name='MP3', ext='mp3')),
+ ('ogg', FileFormat(name='Ogg Vorbis', ext='ogg')),
+ ('daisy', FileFormat(name='DAISY', ext='daisy.zip')),
+ ])
+ format_choices = [(k, _('%s file') % t.name)
+ for k, t in formats.items()]
+
+ type = models.CharField(_('type'), choices=format_choices, max_length="100")