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
18bcbab2
Commit
18bcbab2
authored
7 months ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
export-pion: Bug fixes
parent
44ccfa01
Branches
Branches containing commit
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/export-pion
+11
-11
11 additions, 11 deletions
bin/export-pion
with
11 additions
and
11 deletions
bin/export-pion
+
11
−
11
View file @
18bcbab2
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# Účast ve všech soutěžích ročníku (anonymně)
# Účast ve všech soutěžích ročníku (anonymně)
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
sqlalchemy
import
and_
from
sqlalchemy.orm
import
joinedload
from
sqlalchemy.orm
import
joinedload
import
sys
import
sys
...
@@ -10,14 +11,15 @@ import mo.db as db
...
@@ -10,14 +11,15 @@ import mo.db as db
sess
=
db
.
get_session
()
sess
=
db
.
get_session
()
res
=
(
sess
.
query
(
db
.
Participant
,
db
.
Participation
)
res
=
(
sess
.
query
(
db
.
Participant
,
db
.
Participation
,
db
.
Contest
,
db
.
Round
)
.
select_from
(
db
.
Participant
)
.
select_from
(
db
.
Participant
)
.
join
(
db
.
Participation
,
db
.
Participation
.
user_id
==
db
.
Participant
.
user_id
)
.
join
(
db
.
Participation
,
db
.
Participation
.
user_id
==
db
.
Participant
.
user_id
)
.
join
(
db
.
Contest
,
db
.
Contest
.
contest_id
==
db
.
Participation
.
contest_id
)
.
join
(
db
.
Round
,
and_
(
db
.
Round
.
round_id
==
db
.
Contest
.
round_id
,
db
.
Round
.
year
==
db
.
Participant
.
year
))
.
options
(
joinedload
(
db
.
Participant
.
user
))
.
options
(
joinedload
(
db
.
Participant
.
user
))
.
options
(
joinedload
(
db
.
Participant
.
school_place
).
joinedload
(
db
.
Place
.
parent_place
).
joinedload
(
db
.
Place
.
parent_place
).
joinedload
(
db
.
Place
.
parent_place
))
.
options
(
joinedload
(
db
.
Participant
.
school_place
).
joinedload
(
db
.
Place
.
parent_place
).
joinedload
(
db
.
Place
.
parent_place
).
joinedload
(
db
.
Place
.
parent_place
))
.
options
(
joinedload
(
db
.
Participation
.
place
))
.
options
(
joinedload
(
db
.
Participation
.
place
))
.
options
(
joinedload
(
db
.
Participation
.
contest
).
joinedload
(
db
.
Contest
.
place
))
.
filter
(
db
.
Round
.
master_round_id
==
db
.
Round
.
round_id
)
.
options
(
joinedload
(
db
.
Participation
.
contest
).
joinedload
(
db
.
Contest
.
round
))
.
all
())
.
all
())
...
@@ -35,15 +37,13 @@ class Row:
...
@@ -35,15 +37,13 @@ class Row:
output
=
[]
output
=
[]
for
pant
,
pion
in
res
:
for
pant
,
pion
,
ct
,
rnd
in
res
:
if
pion
.
contest
.
round
.
is_subround
():
continue
output
.
append
(
Row
(
output
.
append
(
Row
(
rocnik
=
str
(
pion
.
contest
.
rou
nd
.
year
),
rocnik
=
str
(
r
nd
.
year
),
kategorie
=
pion
.
contest
.
rou
nd
.
category
,
kategorie
=
r
nd
.
category
,
kolo
=
str
(
pion
.
contest
.
round
.
level
),
kolo
=
str
(
rnd
.
seq
),
misto
=
pion
.
contes
t
.
place
.
name
,
misto
=
c
t
.
place
.
name
,
kod_mista
=
str
(
pion
.
contes
t
.
place
.
place_id
),
kod_mista
=
str
(
c
t
.
place
.
place_id
),
kod_ucastnika
=
str
(
pion
.
user_id
),
kod_ucastnika
=
str
(
pion
.
user_id
),
nazev_skoly
=
pant
.
school_place
.
name
,
nazev_skoly
=
pant
.
school_place
.
name
,
kod_skoly
=
str
(
pant
.
school
),
kod_skoly
=
str
(
pant
.
school
),
...
...
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