--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2017-03-14 17:28
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sites', '0002_alter_domain_unique'),
+ ('organization-media', '0013_mediaimage'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='LiveStreaming',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
+ ('title', models.CharField(max_length=500, verbose_name='Title')),
+ ('title_en', models.CharField(max_length=500, null=True, verbose_name='Title')),
+ ('title_fr', models.CharField(max_length=500, null=True, verbose_name='Title')),
+ ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
+ ('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')),
+ ('description', models.TextField(blank=True, verbose_name='Description')),
+ ('description_en', models.TextField(blank=True, null=True, verbose_name='Description')),
+ ('description_fr', models.TextField(blank=True, null=True, verbose_name='Description')),
+ ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
+ ('created', models.DateTimeField(editable=False, null=True)),
+ ('updated', models.DateTimeField(editable=False, null=True)),
+ ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
+ ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
+ ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
+ ('short_url', models.URLField(blank=True, null=True)),
+ ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
+ ('html5_url', models.URLField(blank=True, max_length=1024, verbose_name='html5 url')),
+ ('html5_url_en', models.URLField(blank=True, max_length=1024, null=True, verbose_name='html5 url')),
+ ('html5_url_fr', models.URLField(blank=True, max_length=1024, null=True, verbose_name='html5 url')),
+ ('youtube_id', models.CharField(blank=True, max_length=64, null=True, verbose_name='youtube id')),
+ ('type', models.CharField(choices=[('html5', 'html5'), ('youtube', 'youtube')], default='html5', max_length=32, verbose_name='type')),
+ ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
+ ],
+ options={
+ 'verbose_name': 'live streaming',
+ 'verbose_name_plural': 'live streamings',
+ },
+ ),
+ ]
('video', _('video')),
]
+LIVE_STREAMING_TYPE_CHOICES = [
+ ('html5', _('html5')),
+ ('youtube', _('youtube')),
+]
+
+
class Media(Displayable):
"""Media"""
class Meta:
verbose_name = _('playlist')
verbose_name_plural = _('playlists')
+
+
+class LiveStreaming(Displayable):
+ """Live streaming"""
+
+ html5_url = models.URLField(_('html5 url'), max_length=1024, blank=True)
+ youtube_id = models.CharField(_('youtube id'), max_length=64, blank=True, null=True)
+ type = models.CharField(_('type'), max_length=32, choices=LIVE_STREAMING_TYPE_CHOICES, default='html5')
+
+ class Meta:
+ verbose_name = "live streaming"
+ verbose_name_plural = "live streamings"
+
+ def __str__(self):
+ return self.title
+
+ def get_absolute_url(self):
+ return reverse("organization-streaming-detail", kwargs={"slug": self.slug})