Project

General

Profile

« Previous | Next » 

Revision ee47faa1

Added by Jérôme Schneider over 12 years ago

Import db: add workers

View differences:

scripts/import_db.py
31 31
    from calebasse.personnes.models import Worker
32 32
    from calebasse.ressources.models import WorkerType
33 33
    for line in tables_data['intervenants']:
34
        print line.keys()
35 34
        # Insert workers
36 35
        for disp in tables_data['discipline']:
37 36
            if disp['id'] == line['discipline']:
38 37
                type = WorkerType.objects.get(name=disp['libelle'])
39
#        Worker.objects.create(
40
#                type=type,
41
#                last_name=line['nom'],
42
#                first_name=line=['prenom'],
43
#                first_name=line=['prenom'],
38
        # TODO : import actif or not
39
        Worker.objects.create(
40
                type=type,
41
                last_name=line['nom'],
42
                first_name=line['prenom'],
43
                email=line['email'],
44
                phone=line['tel'],
45
                gender=int(line['titre']),
46
                )
44 47

  
45 48

  
46 49
def conge_mapper(tables_data, service):

Also available in: Unified diff