Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
6250718c
Commit
6250718c
authored
3 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
ParticipantsFilterForm nepouživat f_
parent
d4b12afc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/org_contest.py
+6
-23
6 additions, 23 deletions
mo/web/org_contest.py
with
6 additions
and
23 deletions
mo/web/org_contest.py
+
6
−
23
View file @
6250718c
...
...
@@ -59,26 +59,6 @@ class ParticipantsFilterForm(PagerForm):
download_csv
=
wtforms
.
SubmitField
(
"
↓ CSV
"
)
download_tsv
=
wtforms
.
SubmitField
(
"
↓ TSV
"
)
# Výstupní hodnoty filtru, None při nepoužitém filtru, prázdná db hodnota při
# nepovedené filtraci (neexistující místo a podobně)
f_school
:
Optional
[
db
.
Place
]
=
None
f_participation_place
:
Optional
[
db
.
Place
]
=
None
f_contest_place
:
Optional
[
db
.
Place
]
=
None
f_participation_state
:
Optional
[
db
.
PartState
]
=
None
def
validate_school
(
self
,
field
):
self
.
f_school
=
field
.
place
def
validate_participation_place
(
self
,
field
):
self
.
f_participation_place
=
field
.
place
def
validate_contest_place
(
self
,
field
):
self
.
f_contest_place
=
field
.
place
def
validate_participation_state
(
self
,
field
):
self
.
f_participation_state
=
None
if
field
.
data
==
'
*
'
else
field
.
data
class
ParticipantsActionForm
(
FlaskForm
):
action_on
=
wtforms
.
RadioField
(
"
Provést akci na
"
,
validators
=
[
validators
.
DataRequired
()],
...
...
@@ -441,12 +421,15 @@ def org_contest_list(id: int, site_id: Optional[int] = None):
filter
=
ParticipantsFilterForm
(
formdata
=
request
.
args
)
if
request
.
args
:
filter
.
validate
()
f_participation_state
=
filter
.
participation_place
.
data
if
not
f_participation_place
:
f_participation_place
=
"
*
"
query
=
get_contestants_query
(
round
=
master_contest
.
round
,
contest
=
master_contest
,
site
=
site
,
school
=
filter
.
f_
school
,
school
=
filter
.
school
.
place
,
# contest_place=filter.f_contest_place,
participation_place
=
filter
.
f_
participation_place
,
participation_state
=
filter
.
f_participation_state
,
participation_place
=
filter
.
participation_place
.
data
,
participation_state
=
f_participation_state
)
action_form
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment