Search for yellow tests and unfinished tests
This commit is contained in:
1 parent
78eb41e698
commit
95e40f58ac
2 files changed
+33
-12
No files matched your search
+17
-8
@@ -1,3 +1,4 @@
|
||||
from django.db.models import F
|
||||
from django.shortcuts import render as djangoRender
|
||||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
from django.contrib.auth import authenticate
|
||||
@@ -199,17 +200,25 @@ def search(request):
|
||||
if request.POST['author'] != '':
|
||||
tests = tests.filter(author=request.POST['author'])
|
||||
|
||||
# Don't show tests that have passed (Default is False)
|
||||
if request.POST['showpassed'] != 'True':
|
||||
# Don't show tests that have passed
|
||||
if request.POST['showgreens'] == 'False':
|
||||
tests = tests.exclude(passed=True)
|
||||
|
||||
# Don't show tests that have failed (Default is False)
|
||||
if request.POST['showfailed'] != 'True':
|
||||
tests = tests.exclude(failed=True)
|
||||
# Don't show tests that have failed yellow
|
||||
if request.POST['showyellows'] == 'False':
|
||||
tests = tests.exclude(failed=True,wins__gte=F('losses'))
|
||||
|
||||
# Don't show tests that have been deleted (Default is True)
|
||||
if request.POST['showdeleted'] != 'False':
|
||||
tests = tests.exclude(deleted=False)
|
||||
# Don't show tests that have failed red
|
||||
if request.POST['showreds'] == 'False':
|
||||
tests = tests.exclude(failed=True,wins__lt=F('losses'))
|
||||
|
||||
# Don't show tests that are unfinished
|
||||
if request.POST['showunfinished'] == 'False':
|
||||
tests = tests.exclude(passed=False,failed=False)
|
||||
|
||||
# Don't show tests that have been deleted
|
||||
if request.POST['showdeleted'] == 'False':
|
||||
tests = tests.exclude(deleted=True)
|
||||
|
||||
# If there are no keywords, we are done searching
|
||||
keywords = request.POST['keywords'].split()
|
||||
|
||||
@@ -18,18 +18,30 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
<br>
|
||||
<label> Show Passed </label>
|
||||
<select name="showpassed">
|
||||
<label> Show Greens </label>
|
||||
<select name="showgreens">
|
||||
<option selected value="True">True</option>
|
||||
<option value="False">False</option>
|
||||
</select>
|
||||
<br>
|
||||
<label> Show Failed </label>
|
||||
<select name="showfailed">
|
||||
<label> Show Yellows </label>
|
||||
<select name="showyellows">
|
||||
<option selected value="True">True</option>
|
||||
<option value="False">False</option>
|
||||
</select>
|
||||
<br>
|
||||
<label> Show Reds </label>
|
||||
<select name="showreds">
|
||||
<option selected value="True">True</option>
|
||||
<option value="False">False</option>
|
||||
</select>
|
||||
<br>
|
||||
<label> Show Unfinished </label>
|
||||
<select name="showunfinished">
|
||||
<option value="True">True</option>
|
||||
<option selected value="False">False</option>
|
||||
</select>
|
||||
<br>
|
||||
<label> Show Deleted </label>
|
||||
<select name="showdeleted">
|
||||
<option value="True">True</option>
|
||||
|
||||
Reference in new issue
Block a user