Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
81562bc0
Commit
81562bc0
authored
9 months ago
by
permcu
Browse files
Options
Downloads
Patches
Plain Diff
Sketch documentations for person backend
parent
22f64a6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!361
Resolve "Add statistics page for absences"
Pipeline
#188396
failed
9 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/schema/__init__.py
+14
-1
14 additions, 1 deletion
aleksis/apps/alsijil/schema/__init__.py
aleksis/apps/alsijil/schema/statistics.py
+42
-0
42 additions, 0 deletions
aleksis/apps/alsijil/schema/statistics.py
with
56 additions
and
1 deletion
aleksis/apps/alsijil/schema/__init__.py
+
14
−
1
View file @
81562bc0
...
@@ -22,7 +22,10 @@ from .absences import (
...
@@ -22,7 +22,10 @@ from .absences import (
LessonsForPersonType
,
LessonsForPersonType
,
AbsencesBatchCreateMutation
,
AbsencesBatchCreateMutation
,
)
)
from
.statistics
import
StatisticsByPersonType
from
.statistics
import
(
StatisticsByPersonType
,
DocumentationByPersonType
,
)
class
Query
(
graphene
.
ObjectType
):
class
Query
(
graphene
.
ObjectType
):
documentations
=
FilterOrderList
(
DocumentationType
)
documentations
=
FilterOrderList
(
DocumentationType
)
...
@@ -54,6 +57,11 @@ class Query(graphene.ObjectType):
...
@@ -54,6 +57,11 @@ class Query(graphene.ObjectType):
person
=
graphene
.
ID
(
required
=
True
),
person
=
graphene
.
ID
(
required
=
True
),
term
=
graphene
.
ID
(
required
=
False
),
term
=
graphene
.
ID
(
required
=
False
),
)
)
documentations_by_person
=
graphene
.
List
(
DocumentationByPersonType
,
person
=
graphene
.
ID
(
required
=
True
),
term
=
graphene
.
ID
(
required
=
False
),
)
statistics_by_group
=
graphene
.
List
(
statistics_by_group
=
graphene
.
List
(
StatisticsByPersonType
,
StatisticsByPersonType
,
group
=
graphene
.
ID
(
required
=
True
),
group
=
graphene
.
ID
(
required
=
True
),
...
@@ -187,6 +195,11 @@ class Query(graphene.ObjectType):
...
@@ -187,6 +195,11 @@ class Query(graphene.ObjectType):
# TODO: Annotate person with necessary information for term.
# TODO: Annotate person with necessary information for term.
return
Person
.
objects
.
get
(
id
=
person
)
return
Person
.
objects
.
get
(
id
=
person
)
@staticmethod
def
resolve_documentations_by_person
(
root
,
info
,
person
,
term
=
None
):
# TODO: Annotate person with necessary information for term.
return
Person
.
objects
.
get
(
id
=
person
)
@staticmethod
@staticmethod
def
resolve_statistics_by_group
(
root
,
info
,
group
,
term
=
None
):
def
resolve_statistics_by_group
(
root
,
info
,
group
,
term
=
None
):
# TODO: Annotate persons with necessary information for term.
# TODO: Annotate persons with necessary information for term.
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/schema/statistics.py
+
42
−
0
View file @
81562bc0
import
graphene
import
graphene
from
aleksis.core.models
import
Person
from
aleksis.core.schema.person
import
PersonType
from
aleksis.apps.cursus.schema
import
SubjectType
from
aleksis.apps.kolego.models.absence
import
AbsenceReason
from
aleksis.apps.kolego.models.absence
import
AbsenceReason
from
aleksis.apps.kolego.schema.absence
import
AbsenceReasonType
from
aleksis.apps.kolego.schema.absence
import
AbsenceReasonType
from
..models
import
ExtraMark
from
..models
import
ExtraMark
...
@@ -58,3 +61,42 @@ class StatisticsByPersonType(graphene.ObjectType):
...
@@ -58,3 +61,42 @@ class StatisticsByPersonType(graphene.ObjectType):
def
resolve_extra_marks
(
root
,
info
):
def
resolve_extra_marks
(
root
,
info
):
# TODO: Return actual ExtraMarks
# TODO: Return actual ExtraMarks
return
ExtraMark
.
objects
.
all
()
return
ExtraMark
.
objects
.
all
()
class
DocumentationByPersonType
(
graphene
.
ObjectType
):
id
=
graphene
.
ID
()
datetime_start
=
graphene
.
Date
()
datetime_end
=
graphene
.
Date
()
group_short_name
=
graphene
.
String
()
teacher
=
graphene
.
Field
(
PersonType
)
subject
=
graphene
.
Field
(
SubjectType
)
absences
=
graphene
.
List
(
AbsenceReasonType
)
extra_marks
=
graphene
.
List
(
ExtraMarkType
)
personal_note
=
graphene
.
String
()
def
resolve_id
(
root
,
info
):
return
1
def
resolve_datetime_start
(
root
,
info
):
return
"
2024-05-27T09:00:00+00:00
"
def
resolve_datetime_end
(
root
,
info
):
return
"
2024-05-27T10:00:00+00:00
"
def
resolve_group_short_name
(
root
,
info
):
return
"
11b
"
def
resolve_teacher
(
root
,
info
):
return
Person
.
objects
.
get
(
id
=
63
)
def
resolve_subject
(
root
,
info
):
return
Subject
.
objects
.
get
(
id
=
1
)
def
resolve_absences
(
root
,
info
):
return
AbsenceReason
.
objects
.
all
()
def
resolve_extra_marks
(
root
,
info
):
return
ExtraMark
.
objects
.
all
()
def
resolve_personal_note
(
root
,
info
):
return
"
All is well:)
"
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