From: Guillaume Pellerin Date: Mon, 21 Jan 2019 18:00:24 +0000 (+0100) Subject: Add ClassGroup pull command, add Conference.streaming X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3a1d50a8296457697d718bfb497bf52a9d661d2a;p=teleforma.git Add ClassGroup pull command, add Conference.streaming --- diff --git a/teleforma/management/commands/teleforma-pull-class_groups.py b/teleforma/management/commands/teleforma-pull-class_groups.py new file mode 100644 index 00000000..dbc579ab --- /dev/null +++ b/teleforma/management/commands/teleforma-pull-class_groups.py @@ -0,0 +1,22 @@ +from optparse import make_option +from django.conf import settings +from django.core.management.base import BaseCommand, CommandError +from django.contrib.auth.models import User +from django.template.defaultfilters import slugify +from telemeta.models import * +from telemeta.util.unaccent import unaccent +from teleforma.models import * +from teleforma.views import * +import logging +import codecs + + +class Command(BaseCommand): + help = "pull teleforma courses from a remote host for an organization" + admin_email = 'webmaster@parisson.com' + args = "organization_name" + + def handle(self, *args, **options): + organization_name = args[-1] + view = ClassGroupView() + view.pull(organization_name) diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 1f1b3c06..9dc13ee2 100644 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -236,7 +236,7 @@ class Course(Model): """ periods = [ p['id'] for p in self.periods.values('id') ] return not periods or period.id in periods - + class Meta(MetaCore): db_table = app_label + '_' + 'course' verbose_name = _('course') @@ -330,6 +330,7 @@ class Conference(Model): status = models.IntegerField(_('status'), choices=STATUS_CHOICES, default=2) class_group = models.ForeignKey('ClassGroup', related_name='conferences', verbose_name=_('class group'), blank=True, null=True, on_delete=models.SET_NULL) + streaming = models.BooleanField(_('streaming')) @property def description(self):