cmsplugin-youtube / cmsplugin_youtube / models.py

from django.db import models
from django.utils.translation import ugettext as _

from cms.models import CMSPlugin

from cmsplugin_youtube import settings

class YouTube(CMSPlugin):
    video_id = models.CharField(_('video id'), max_length=60)

    autoplay = models.BooleanField(
        _('autoplay'),
        default=settings.CMS_YOUTUBE_DEFAULT_AUTOPLAY
    )

    width = models.IntegerField(_('width'),
            default=settings.CMS_YOUTUBE_DEFAULT_WIDTH)
    height = models.IntegerField(_('height'),
            default=settings.CMS_YOUTUBE_DEFAULT_HEIGHT)
    border = models.BooleanField(_('border'),
            default=settings.CMS_YOUTUBE_DEFAULT_BORDER)

    allow_fullscreen = models.BooleanField(
        _('allow fullscreen'),
        default=settings.CMS_YOUTUBE_DEFAULT_FULLSCREEN
    )

    loop = models.BooleanField(_('loop'),
            default=settings.CMS_YOUTUBE_DEFAULT_LOOP)

    display_related_videos = models.BooleanField(
        _('display related videos'),
        default=settings.CMS_YOUTUBE_DEFAULT_RELATED
    )

    high_quality = models.BooleanField(
        _('high quality'),
        default=settings.CMS_YOUTUBE_DEFAULT_HIGHQUALITY
    )

    def __unicode__(self):
        return u'%s' % (self.video_id,)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.