]> git.parisson.com Git - teleforma.git/commitdiff
Add ClassGroup pull command, add Conference.streaming
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 21 Jan 2019 18:00:24 +0000 (19:00 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 21 Jan 2019 18:00:24 +0000 (19:00 +0100)
teleforma/management/commands/teleforma-pull-class_groups.py [new file with mode: 0644]
teleforma/models/core.py

diff --git a/teleforma/management/commands/teleforma-pull-class_groups.py b/teleforma/management/commands/teleforma-pull-class_groups.py
new file mode 100644 (file)
index 0000000..dbc579a
--- /dev/null
@@ -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)
index 1f1b3c06d231bbbaf335f0aaf462b17de9209511..9dc13ee2ee0a3d4529235639bdf2fc1bf071cb07 100644 (file)
@@ -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):