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
ccde2e29
Verified
Commit
ccde2e29
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Filter lesosns for current term and pass weeks in term to template.
parent
393f8a74
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biscuit/apps/alsijil/views.py
+13
-0
13 additions, 0 deletions
biscuit/apps/alsijil/views.py
with
13 additions
and
0 deletions
biscuit/apps/alsijil/views.py
+
13
−
0
View file @
ccde2e29
...
@@ -183,6 +183,9 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
...
@@ -183,6 +183,9 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
~
Q
(
topic__exact
=
''
),
~
Q
(
topic__exact
=
''
),
lesson_period
=
OuterRef
(
'
pk
'
),
lesson_period
=
OuterRef
(
'
pk
'
),
))
))
).
filter
(
lesson__date_start__gte
=
group
.
school
.
current_term
.
date_start
,
lesson__date_end__lte
=
group
.
school
.
current_term
.
date_end
).
select_related
(
).
select_related
(
'
lesson
'
,
'
lesson__subject
'
,
'
period
'
,
'
room
'
'
lesson
'
,
'
lesson__subject
'
,
'
period
'
,
'
room
'
).
prefetch_related
(
).
prefetch_related
(
...
@@ -213,8 +216,18 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
...
@@ -213,8 +216,18 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
))
))
)
)
weeks
=
CalendarWeek
.
weeks_within
(
group
.
school
.
current_term
.
date_start
,
group
.
school
.
current_term
.
date_end
)
periods_by_day
=
{}
for
week
in
weeks
:
for
day
in
week
:
periods_by_day
[
day
]
=
lesson_periods
.
filter
(
period__weekday
=
day
.
isoweekday
()
)
context
[
'
group
'
]
=
group
context
[
'
group
'
]
=
group
context
[
'
weeks
'
]
=
weeks
context
[
'
lesson_periods
'
]
=
lesson_periods
context
[
'
lesson_periods
'
]
=
lesson_periods
context
[
'
periods_by_day
'
]
=
periods_by_day
context
[
'
persons
'
]
=
persons
context
[
'
persons
'
]
=
persons
return
render
(
request
,
'
alsijil/print/full_register.html
'
,
context
)
return
render
(
request
,
'
alsijil/print/full_register.html
'
,
context
)
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