Assouplir l'ajout d'instructions lors des corrections par l'administrateur
def instradmin(request, bdd, id)
LIBRARY_CHOICES = ('checker', 'checker'),
REM_CHOICES =('',''),
for itlmt in ItemRecord.objects.using(bdd).filter(sid =sid):
if not itlmt.excl:
l = Library.objects.using(bdd).get(lid = itlmt.lid)
LIBRARY_CHOICES += (l.name, l.name),
if not l.lid ==lid:
REM_CHOICES += (l.name, l.name),
supprimer la condition if not l.lid ==lid et supprimer 'checker' donc de LIBRARY_CHOICES: de manière à rendre plus libre l'ajout de lignes, ce qui donnera donc : LIBRARY_CHOICES = ('', ''), REM_CHOICES =('',''), for itlmt in ItemRecord.objects.using(bdd).filter(sid =sid): if not itlmt.excl: l = Library.objects.using(bdd).get(lid = itlmt.lid) LIBRARY_CHOICES += (l.name, l.name), REM_CHOICES += (l.name, l.name), LIBRARY_CHOICES = LIBRARY_CHOICES[1:]
Edited by Georges Gressot