]> git.parisson.com Git - teleforma.git/commitdiff
add command
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 16 Mar 2021 21:03:36 +0000 (22:03 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 16 Mar 2021 21:03:36 +0000 (22:03 +0100)
teleforma/management/commands/teleforma-import-students-from-xls.py [new file with mode: 0644]
teleforma/views/crfpa.py

diff --git a/teleforma/management/commands/teleforma-import-students-from-xls.py b/teleforma/management/commands/teleforma-import-students-from-xls.py
new file mode 100644 (file)
index 0000000..30e1d7f
--- /dev/null
@@ -0,0 +1,23 @@
+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.util.unaccent import unaccent
+from teleforma.views import *
+import logging
+import json
+
+
+class Command(BaseCommand):
+    help = "Import Students from XLS file"
+    args = "path"
+    admin_email = 'webmaster@parisson.com'
+
+    def handle(self, *args, **options):
+        file = args[0]
+        xls = UserXLSBook()
+        xls.read(file)
+
+
+
index 300259769a344970f5d1675b19031bdcceef673f..4a221c2f9859a30ab86342b06bc8fe196e1de199 100644 (file)
@@ -51,6 +51,9 @@ from django.forms.formsets import all_valid
 from django.core.exceptions import ValidationError
 from django.contrib.sites.models import Site
 
+import xlrd
+
+
 ORAL_OPTION_PRICE = 250
 
 def get_course_code(obj):