Simplified student import process

This commit is contained in:
Claude Paroz 2016-01-19 10:27:53 +01:00
parent 7d45cd0047
commit 03f45f0785
5 changed files with 89 additions and 8 deletions

View file

@ -110,6 +110,22 @@ INSTALLED_APPS = (
'stages',
)
FILE_UPLOAD_HANDLERS = ["django.core.files.uploadhandler.TemporaryFileUploadHandler"]
ALLOWED_HOSTS = ['localhost', 'stages.pierre-coullery.ch']
# Mapping between column names of a tabular file and Student field names
STUDENT_IMPORT_MAPPING = {
'Num élève': 'ext_id',
'Nom élève': 'last_name',
'Prénom élève': 'first_name',
'Rue élève': 'street',
'Localité élève': 'city', # pcode is separated from city in prepare_import
'Tél. élève': 'tel',
'Natel élève': 'mobile',
'Email élève': 'email',
'Date nais. élève': 'birth_date',
'Classe': 'klass',
}
from .local_settings import *

View file

@ -8,7 +8,7 @@ urlpatterns = [
url(r'^$', RedirectView.as_view(url='/admin/', permanent=True), name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^data-import/', include('tabimport.urls')),
url(r'^data-import/', views.StudentImportView.as_view(), name='tabimport'),
url(r'^attribution/$', views.AttributionView.as_view(), name='attribution'),
url(r'^stages/export/(?P<scope>all)?/?$', views.stages_export, name='stages_export'),