old_contents: from django.db import models
  from django.template.loader import render_to_string
  from django.utils.translation import ugettext_lazy as _
  
  from feincms.module.medialibrary.fields import ContentWithMediaFile
  
  
  class MediaFileContent(ContentWithMediaFile):
      """
      Rehashed, backwards-incompatible media file content which does not contain
      the problems from v1 anymore.
  
      Create a media file content as follows::
  
          from feincms.content.medialibrary.v2 import MediaFileContent
          Page.create_content_type(MediaFileContent, TYPES=(
              ('default', _('Default')),
              ('lightbox', _('Lightbox')),
              ('whatever', _('Whatever')),
              ))
  
      For a media file of type 'image' and type 'lightbox', the following
      templates are tried in order:
  
      * content/mediafile/image_lightbox.html
      * content/mediafile/image.html
      * content/mediafile/lightbox.html
      * content/mediafile/default.html
  
      The context contains ``content`` and ``request`` (if available).
      """
  
      class Meta:
          abstract = True
          verbose_name = _('media file')
          verbose_name_plural = _('media files')
  
      @classmethod
      def initialize_type(cls, TYPES=None, MEDIAFILE_CLASS=MediaFile):
          cls.add_to_class('type', models.CharField(_('type'),
              max_length=10, choices=TYPES, default=TYPES[0][0]))
  
      def render(self, **kwargs):
          ctx = {'content': self}
          ctx.update(kwargs)
  
          return render_to_string([
              'content/mediafile/%s_%s.html' % (self.mediafile.type, self.type),
              'content/mediafile/%s.html' % self.mediafile.type,
              'content/mediafile/%s.html' % self.type,
              'content/mediafile/default.html',
              ], ctx)
  
  
  
new_contents: from django.contrib import admin
  from django.db import models
  from django.template.loader import render_to_string
  from django.utils.translation import ugettext_lazy as _
  
  from feincms.admin.item_editor import FeinCMSInline
  from feincms.module.medialibrary.fields import ContentWithMediaFile
  
  
  class MediaFileContentInline(FeinCMSInline):
      raw_id_fields = ('mediafile',)
      radio_fields = {'type': admin.VERTICAL}
  
  
  class MediaFileContent(ContentWithMediaFile):
      """
      Rehashed, backwards-incompatible media file content which does not contain
      the problems from v1 anymore.
  
      Create a media file content as follows::
  
          from feincms.content.medialibrary.v2 import MediaFileContent
          Page.create_content_type(MediaFileContent, TYPES=(
              ('default', _('Default')),
              ('lightbox', _('Lightbox')),
              ('whatever', _('Whatever')),
              ))
  
      For a media file of type 'image' and type 'lightbox', the following
      templates are tried in order:
  
      * content/mediafile/image_lightbox.html
      * content/mediafile/image.html
      * content/mediafile/lightbox.html
      * content/mediafile/default.html
  
      The context contains ``content`` and ``request`` (if available).
      """
  
      feincms_item_editor_inline = MediaFileContentInline
  
      class Meta:
          abstract = True
          verbose_name = _('media file')
          verbose_name_plural = _('media files')
  
      @classmethod
      def initialize_type(cls, TYPES=None):
          cls.add_to_class('type', models.CharField(_('type'),
              max_length=10, choices=TYPES, default=TYPES[0][0]))
  
      def render(self, **kwargs):
          ctx = {'content': self}
          ctx.update(kwargs)
  
          return render_to_string([
              'content/mediafile/%s_%s.html' % (self.mediafile.type, self.type),
              'content/mediafile/%s.html' % self.mediafile.type,
              'content/mediafile/%s.html' % self.type,
              'content/mediafile/default.html',
              ], ctx)
  
  
  
subject: Fix v2.MediaFileContent bugs, use radio buttons for type