Commit 48b67c10 authored by Georges Gressot's avatar Georges Gressot 💬
Browse files

...

parent 9a553701
...@@ -66,8 +66,7 @@ def selectbdd(request): ...@@ -66,8 +66,7 @@ def selectbdd(request):
# BDD_CHOICES =BDD_CHOICES[1:] # BDD_CHOICES =BDD_CHOICES[1:]
if len(BDD_CHOICES) ==2: if len(BDD_CHOICES) ==2:
return HttpResponse(request.method) return home(request, BDD_CHOICES[1][0])
# return home(request, BDD_CHOICES[1][0])
else: else:
class BddSel_Form(forms.Form): class BddSel_Form(forms.Form):
bddname = forms.ChoiceField(required = True, widget=forms.Select, choices=BDD_CHOICES) bddname = forms.ChoiceField(required = True, widget=forms.Select, choices=BDD_CHOICES)
...@@ -77,8 +76,8 @@ def selectbdd(request): ...@@ -77,8 +76,8 @@ def selectbdd(request):
if f.is_valid(): if f.is_valid():
bdd = f.cleaned_data['bddname'] bdd = f.cleaned_data['bddname']
request.method = "GET" request.method = "GET"
return HttpResponse(request.method) # return HttpResponse(request.method + BDD_CHOICES[1][0])
# return home(request, bdd) return home(request, bdd)
return render(request, 'epl/selectbdd.html', locals()) return render(request, 'epl/selectbdd.html', locals())
...@@ -100,7 +99,7 @@ def home(request, bdd): ...@@ -100,7 +99,7 @@ def home(request, bdd):
project = Project.objects.using(bdd).all().order_by('pk')[0].name project = Project.objects.using(bdd).all().order_by('pk')[0].name
LIBRARY_CHOICES = ('checker','checker'), LIBRARY_CHOICES = ('', 'Choisissez votre bibliothèque'),('checker','checker'),
if Library.objects.using(bdd).all().exclude(name ='checker'): if Library.objects.using(bdd).all().exclude(name ='checker'):
for l in Library.objects.using(bdd).all().exclude(name ='checker').order_by('name'): for l in Library.objects.using(bdd).all().exclude(name ='checker').order_by('name'):
LIBRARY_CHOICES += (l.name, l.name), LIBRARY_CHOICES += (l.name, l.name),
...@@ -166,30 +165,26 @@ def home(request, bdd): ...@@ -166,30 +165,26 @@ def home(request, bdd):
form = FeatureForm(request.POST, instance =i) form = FeatureForm(request.POST, instance =i)
if not request.method == "GET": if form.is_valid():
if form.is_valid(): lid = Library.objects.using(bdd).get(name =i.libname).lid
lid = Library.objects.using(bdd).get(name =i.libname).lid feature =i.feaname
feature =i.feaname if not Feature.objects.using(bdd).filter(feaname =feature, libname =i.libname):
if not Feature.objects.using(bdd).filter(feaname =feature, libname =i.libname): i.save(using=bdd)
i.save(using=bdd)
if lid =="999999999": if lid =="999999999":
if feature =='instrtodo': if feature =='instrtodo':
return instrtodo(request, bdd, lid, 'title') return instrtodo(request, bdd, lid, 'title')
else:
return checkinstr(request, bdd)
else: else:
if feature =='ranking': return checkinstr(request, bdd)
return ranktotake(request, bdd, lid, 'title') else:
elif feature =='arbitration': if feature =='ranking':
return arbitration(request, bdd, lid, 'title') return ranktotake(request, bdd, lid, 'title')
elif feature =='instrtodo': elif feature =='arbitration':
return instrtodo(request, bdd, lid, 'title') return arbitration(request, bdd, lid, 'title')
elif feature =='edition': elif feature =='instrtodo':
return tobeedited(request, bdd, lid, 'title') return instrtodo(request, bdd, lid, 'title')
# else: elif feature =='edition':
# return HttpResponse(str(form.is_valid()) + str(i)) return tobeedited(request, bdd, lid, 'title')
gift =a
return render(request, 'epl/home.html', locals()) return render(request, 'epl/home.html', locals())
...@@ -369,9 +364,6 @@ def lang(request, bdd): ...@@ -369,9 +364,6 @@ def lang(request, bdd):
k =logstatus(request) k =logstatus(request)
version =epl_version version =epl_version
return render(request, 'epl/language.html', locals()) return render(request, 'epl/language.html', locals())
...@@ -385,8 +377,6 @@ def logout_view(request, bdd): ...@@ -385,8 +377,6 @@ def logout_view(request, bdd):
version =epl_version version =epl_version
project = Project.objects.using(bdd).all().order_by('pk')[0].name project = Project.objects.using(bdd).all().order_by('pk')[0].name
#Feature input : #Feature input :
...@@ -410,8 +400,8 @@ def logout_view(request, bdd): ...@@ -410,8 +400,8 @@ def logout_view(request, bdd):
if form.is_valid(): if form.is_valid():
lid = Library.objects.using(bdd).get(name =i.libname).lid lid = Library.objects.using(bdd).get(name =i.libname).lid
feature =i.feaname feature =i.feaname
# if not Feature.objects.using(bdd).filter(feaname = i.feaname, libname =i.libname): if not Feature.objects.using(bdd).filter(feaname = i.feaname, libname =i.libname):
i.save(using=bdd) i.save(using=bdd)
if lid =="999999999": if lid =="999999999":
if feature =='instrtodo': if feature =='instrtodo':
return instrtodo(request, bdd, lid, 'title') return instrtodo(request, bdd, lid, 'title')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment