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
c7e932de
Commit
c7e932de
authored
2 weeks ago
by
Martin Mareš
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master' into devel
parents
88d79e05
56a83645
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
bin/export-pion
+6
-3
6 additions, 3 deletions
bin/export-pion
with
6 additions
and
3 deletions
bin/export-pion
+
6
−
3
View file @
c7e932de
...
@@ -19,12 +19,12 @@ sess = db.get_session()
...
@@ -19,12 +19,12 @@ sess = db.get_session()
points_by_uid_roundid
:
DefaultDict
[
Tuple
[
int
,
int
],
Decimal
]
=
defaultdict
(
Decimal
)
points_by_uid_roundid
:
DefaultDict
[
Tuple
[
int
,
int
],
Decimal
]
=
defaultdict
(
Decimal
)
sols
=
(
sess
.
query
(
db
.
Solution
)
sols
=
(
sess
.
query
(
db
.
Solution
)
.
options
(
joinedload
(
db
.
Solution
.
task
))
.
options
(
joinedload
(
db
.
Solution
.
task
)
.
joinedload
(
db
.
Task
.
round
)
)
.
all
())
.
all
())
for
sol
in
sols
:
for
sol
in
sols
:
if
sol
.
points
is
not
None
:
if
sol
.
points
is
not
None
:
points_by_uid_roundid
[
sol
.
user_id
,
sol
.
task
.
round_id
]
+=
sol
.
points
points_by_uid_roundid
[
sol
.
user_id
,
sol
.
task
.
round
.
master_round
_id
]
+=
sol
.
points
res
=
(
sess
.
query
(
db
.
Participant
,
db
.
Participation
,
db
.
Contest
,
db
.
Round
)
res
=
(
sess
.
query
(
db
.
Participant
,
db
.
Participation
,
db
.
Contest
,
db
.
Round
)
.
select_from
(
db
.
Participant
)
.
select_from
(
db
.
Participant
)
...
@@ -33,6 +33,7 @@ res = (sess.query(db.Participant, db.Participation, db.Contest, db.Round)
...
@@ -33,6 +33,7 @@ res = (sess.query(db.Participant, db.Participation, db.Contest, db.Round)
.
join
(
db
.
Round
,
and_
(
db
.
Round
.
round_id
==
db
.
Contest
.
round_id
,
db
.
Round
.
year
==
db
.
Participant
.
year
))
.
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
.
Participant
.
school_place
).
joinedload
(
db
.
Place
.
school
))
.
options
(
joinedload
(
db
.
Participation
.
place
))
.
options
(
joinedload
(
db
.
Participation
.
place
))
.
filter
(
db
.
Round
.
master_round_id
==
db
.
Round
.
round_id
)
.
filter
(
db
.
Round
.
master_round_id
==
db
.
Round
.
round_id
)
.
filter
(
db
.
Participation
.
state
==
db
.
PartState
.
active
)
.
filter
(
db
.
Participation
.
state
==
db
.
PartState
.
active
)
...
@@ -52,6 +53,7 @@ class Row(mo.csv.Row):
...
@@ -52,6 +53,7 @@ class Row(mo.csv.Row):
trida
:
str
=
""
trida
:
str
=
""
nazev_skoly
:
str
=
""
nazev_skoly
:
str
=
""
id_skoly
:
str
=
""
id_skoly
:
str
=
""
izo_skoly
:
str
=
""
mesto_skoly
:
str
=
""
mesto_skoly
:
str
=
""
okres_skoly
:
str
=
""
okres_skoly
:
str
=
""
kraj_skoly
:
str
=
""
kraj_skoly
:
str
=
""
...
@@ -71,7 +73,7 @@ for pant, pion, ct, rnd in res:
...
@@ -71,7 +73,7 @@ for pant, pion, ct, rnd in res:
rocnik
=
str
(
rnd
.
year
),
rocnik
=
str
(
rnd
.
year
),
kategorie
=
rnd
.
category
,
kategorie
=
rnd
.
category
,
kolo_seq
=
str
(
rnd
.
seq
),
kolo_seq
=
str
(
rnd
.
seq
),
kolo
=
rnd
.
name
,
kolo
=
rnd
.
round_type
.
friendly_name
()
if
rnd
.
round_type
!=
db
.
RoundType
.
other
else
rnd
.
name
,
misto
=
ct
.
place
.
name
,
misto
=
ct
.
place
.
name
,
id_mista
=
str
(
ct
.
place
.
place_id
),
id_mista
=
str
(
ct
.
place
.
place_id
),
nuts_mista
=
str
(
ct
.
place
.
nuts
)
if
ct
.
place
.
nuts
else
""
,
nuts_mista
=
str
(
ct
.
place
.
nuts
)
if
ct
.
place
.
nuts
else
""
,
...
@@ -79,6 +81,7 @@ for pant, pion, ct, rnd in res:
...
@@ -79,6 +81,7 @@ for pant, pion, ct, rnd in res:
trida
=
pant
.
grade
,
trida
=
pant
.
grade
,
nazev_skoly
=
pant
.
school_place
.
name
,
nazev_skoly
=
pant
.
school_place
.
name
,
id_skoly
=
str
(
pant
.
school
),
id_skoly
=
str
(
pant
.
school
),
izo_skoly
=
pant
.
school_place
.
school
.
red_izo
or
""
,
mesto_skoly
=
pant
.
school_place
.
parent_place
.
name
,
mesto_skoly
=
pant
.
school_place
.
parent_place
.
name
,
okres_skoly
=
pant
.
school_place
.
parent_place
.
parent_place
.
name
,
okres_skoly
=
pant
.
school_place
.
parent_place
.
parent_place
.
name
,
kraj_skoly
=
pant
.
school_place
.
parent_place
.
parent_place
.
parent_place
.
name
,
kraj_skoly
=
pant
.
school_place
.
parent_place
.
parent_place
.
parent_place
.
name
,
...
...
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