Commit f59e359a authored by Georges Gressot's avatar Georges Gressot 💬
Browse files

trying ...

parent 605c0100
...@@ -25,6 +25,8 @@ from django.contrib.auth import logout ...@@ -25,6 +25,8 @@ from django.contrib.auth import logout
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.http import HttpResponse
lastrked =None lastrked =None
wbmstr ="" wbmstr =""
...@@ -56,6 +58,7 @@ def selectbdd(request): ...@@ -56,6 +58,7 @@ def selectbdd(request):
if f.is_valid(): if f.is_valid():
bdd = f.cleaned_data['bddname'] bdd = f.cleaned_data['bddname']
return HttpResponseRedirect(bdd) return HttpResponseRedirect(bdd)
return bdd
# return home(request, bdd) # return home(request, bdd)
return render(request, 'epl/selectbdd.html', locals()) return render(request, 'epl/selectbdd.html', locals())
...@@ -72,7 +75,7 @@ def common(request, bdd): ...@@ -72,7 +75,7 @@ def common(request, bdd):
replymail =ReplyMail.objects.using(bdd).all().order_by('pk')[0].sendermail replymail =ReplyMail.objects.using(bdd).all().order_by('pk')[0].sendermail
except: except:
replymail =BddAdmin.objects.using(bdd).all().order_by('pk')[0].contact replymail =BddAdmin.objects.using(bdd).all().order_by('pk')[0].contact
return wbmstr, replymail return locals()
def logstatus(request, bdd): def logstatus(request, bdd):
...@@ -85,52 +88,53 @@ def logstatus(request, bdd): ...@@ -85,52 +88,53 @@ def logstatus(request, bdd):
def home(request, bdd): def home(request, bdd):
return logstatus(request, bdd) # return logstatus(request, bdd)
version =epl_version version =epl_version
return common(request, bdd) # return common(request, bdd)
"Homepage" "Homepage"
#
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 :
i = Feature() # i = Feature()
#
LIBRARY_CHOICES = ('checker','checker'), # LIBRARY_CHOICES = ('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),
#
class FeatureForm(forms.ModelForm): # class FeatureForm(forms.ModelForm):
class Meta: # class Meta:
model = Feature # model = Feature
fields = ('libname', 'feaname',) # fields = ('libname', 'feaname',)
widgets = { # widgets = {
'libname' : forms.Select(choices=LIBRARY_CHOICES), # 'libname' : forms.Select(choices=LIBRARY_CHOICES),
'feaname' : forms.RadioSelect(choices=FEATURE_CHOICES), # 'feaname' : forms.RadioSelect(choices=FEATURE_CHOICES),
} # }
form = FeatureForm(request.POST, instance =i) # form = FeatureForm(request.POST, instance =i)
#
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: # else:
return checkinstr(request, bdd) # return checkinstr(request, bdd)
else: # else:
if feature =='ranking': # if feature =='ranking':
return ranktotake(request, bdd, lid, 'title') # return ranktotake(request, bdd, lid, 'title')
elif feature =='arbitration': # elif feature =='arbitration':
return arbitration(request, bdd, lid, 'title') # return arbitration(request, bdd, lid, 'title')
elif feature =='instrtodo': # elif feature =='instrtodo':
return instrtodo(request, bdd, lid, 'title') # return instrtodo(request, bdd, lid, 'title')
elif feature =='edition': # elif feature =='edition':
return tobeedited(request, bdd, lid, 'title') # return tobeedited(request, bdd, lid, 'title')
return HttpResponse(bdd)
return render(request, 'epl/home.html', locals()) return render(request, 'epl/home.html', locals())
......
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