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
ff3776c2
Verified
Commit
ff3776c2
authored
3 years ago
by
Hangzhi Yu
Committed by
Jonathan Weth
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Set start date of current SchoolTerm as default value for personal note filter
parent
9f7b46b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!260
Resolve "Show only personal notes from current term"
Pipeline
#49493
passed
3 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+5
-0
5 additions, 0 deletions
CHANGELOG.rst
aleksis/apps/alsijil/filters.py
+14
-3
14 additions, 3 deletions
aleksis/apps/alsijil/filters.py
with
19 additions
and
3 deletions
CHANGELOG.rst
+
5
−
0
View file @
ff3776c2
...
...
@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Changed
~~~~~~~
* Use start date of current SchoolTerm as default value for PersonalNote filter in overview.
`2.0rc7` - 2021-12-25
---------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/filters.py
+
14
−
3
View file @
ff3776c2
...
...
@@ -3,16 +3,27 @@ from django.utils.translation import gettext as _
from
django_filters
import
CharFilter
,
DateFilter
,
FilterSet
from
material
import
Layout
,
Row
from
aleksis.core.models
import
SchoolTerm
from
.models
import
PersonalNote
class
PersonalNoteFilter
(
FilterSet
):
day_start
=
DateFilter
(
lookup_expr
=
"
gte
"
,
label
=
_
(
"
After
"
))
day_start
=
DateFilter
(
lookup_expr
=
"
gte
"
,
label
=
_
(
"
After
"
),
initial
=
SchoolTerm
.
current
.
date_start
)
day_end
=
DateFilter
(
lookup_expr
=
"
lte
"
,
label
=
_
(
"
Before
"
))
subject
=
CharFilter
(
lookup_expr
=
"
icontains
"
,
label
=
_
(
"
Subject
"
))
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
def
__init__
(
self
,
data
=
None
,
*
args
,
**
kwargs
):
if
data
is
not
None
:
data
=
data
.
copy
()
for
name
,
f
in
self
.
base_filters
.
items
():
initial
=
f
.
extra
.
get
(
"
initial
"
)
if
not
data
.
get
(
name
)
and
initial
:
data
[
name
]
=
initial
super
().
__init__
(
data
,
*
args
,
**
kwargs
)
self
.
form
.
fields
[
"
late__lt
"
].
label
=
_
(
"
Tardiness is lower than
"
)
self
.
form
.
fields
[
"
late__gt
"
].
label
=
_
(
"
Tardiness is bigger than
"
)
self
.
form
.
layout
=
Layout
(
...
...
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