Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Paul Milleville
SCODOC_R6A06
Commits
8847a1f0
Commit
8847a1f0
authored
1 year ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
Fix warning set_ue_poids_dict. Add type_abbrev() method.
parent
ac882e9c
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
app/models/evaluations.py
+15
-2
15 additions, 2 deletions
app/models/evaluations.py
with
15 additions
and
2 deletions
app/models/evaluations.py
+
15
−
2
View file @
8847a1f0
...
@@ -71,6 +71,15 @@ class Evaluation(models.ScoDocModel):
...
@@ -71,6 +71,15 @@ class Evaluation(models.ScoDocModel):
EVALUATION_BONUS
,
EVALUATION_BONUS
,
}
}
def
type_abbrev
(
self
)
->
str
:
"
Le nom abrégé du type de cette éval.
"
return
{
self
.
EVALUATION_NORMALE
:
"
std
"
,
self
.
EVALUATION_RATTRAPAGE
:
"
rattrapage
"
,
self
.
EVALUATION_SESSION2
:
"
session 2
"
,
self
.
EVALUATION_BONUS
:
"
bonus
"
,
}.
get
(
self
.
evaluation_type
,
"
?
"
)
def
__repr__
(
self
):
def
__repr__
(
self
):
return
f
"""
<Evaluation
{
self
.
id
}
{
return
f
"""
<Evaluation
{
self
.
id
}
{
self
.
date_debut
.
isoformat
()
if
self
.
date_debut
else
''
}
"
{
self
.
date_debut
.
isoformat
()
if
self
.
date_debut
else
''
}
"
{
...
@@ -417,12 +426,13 @@ class Evaluation(models.ScoDocModel):
...
@@ -417,12 +426,13 @@ class Evaluation(models.ScoDocModel):
return
modified
return
modified
def
set_ue_poids
(
self
,
ue
,
poids
:
float
)
->
None
:
def
set_ue_poids
(
self
,
ue
,
poids
:
float
)
->
None
:
"""
Set poids évaluation vers cette UE
"""
"""
Set poids évaluation vers cette UE
. Commit.
"""
self
.
update_ue_poids_dict
({
ue
.
id
:
poids
})
self
.
update_ue_poids_dict
({
ue
.
id
:
poids
})
def
set_ue_poids_dict
(
self
,
ue_poids_dict
:
dict
)
->
None
:
def
set_ue_poids_dict
(
self
,
ue_poids_dict
:
dict
)
->
None
:
"""
set poids vers les UE (remplace existants)
"""
set poids vers les UE (remplace existants)
ue_poids_dict = { ue_id : poids }
ue_poids_dict = { ue_id : poids }
Commit session.
"""
"""
from
app.models.ues
import
UniteEns
from
app.models.ues
import
UniteEns
...
@@ -432,9 +442,12 @@ class Evaluation(models.ScoDocModel):
...
@@ -432,9 +442,12 @@ class Evaluation(models.ScoDocModel):
if
ue
is
None
:
if
ue
is
None
:
raise
ScoValueError
(
"
poids vers une UE inexistante
"
)
raise
ScoValueError
(
"
poids vers une UE inexistante
"
)
ue_poids
=
EvaluationUEPoids
(
evaluation
=
self
,
ue
=
ue
,
poids
=
poids
)
ue_poids
=
EvaluationUEPoids
(
evaluation
=
self
,
ue
=
ue
,
poids
=
poids
)
L
.
append
(
ue_poids
)
db
.
session
.
add
(
ue_poids
)
db
.
session
.
add
(
ue_poids
)
L
.
append
(
ue_poids
)
self
.
ue_poids
=
L
# backref # pylint:disable=attribute-defined-outside-init
self
.
ue_poids
=
L
# backref # pylint:disable=attribute-defined-outside-init
db
.
session
.
commit
()
self
.
moduleimpl
.
invalidate_evaluations_poids
()
# inval cache
self
.
moduleimpl
.
invalidate_evaluations_poids
()
# inval cache
def
update_ue_poids_dict
(
self
,
ue_poids_dict
:
dict
)
->
None
:
def
update_ue_poids_dict
(
self
,
ue_poids_dict
:
dict
)
->
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