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
26a4d506
Commit
26a4d506
authored
3 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Filter date and subject of personal notes
parent
5559ac94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!111
Resolve "[Person overview] Implement multiple selection for marking absences as excused or for deleting"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/filters.py
+10
-5
10 additions, 5 deletions
aleksis/apps/alsijil/filters.py
with
10 additions
and
5 deletions
aleksis/apps/alsijil/filters.py
+
10
−
5
View file @
26a4d506
from
django.utils.translation
import
gettext
as
_
from
django_filters
import
FilterSet
,
CharFilter
,
ModelMultipleChoiceFilter
from
django_filters
import
FilterSet
,
CharFilter
,
ModelMultipleChoiceFilter
,
DateFilter
from
material
import
Layout
,
Row
from
.models
import
ExcuseType
,
PersonalNote
class
PersonalNoteFilter
(
FilterSet
):
day_start
=
DateFilter
(
lookup_expr
=
"
gte
"
,
label
=
_
(
"
After
"
))
day_end
=
DateFilter
(
lookup_expr
=
"
lte
"
,
label
=
_
(
"
Before
"
))
subject
=
CharFilter
(
lookup_expr
=
"
icontains
"
,
label
=
_
(
"
Subject
"
))
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
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
(
# TODO: Row with day (lt and gt) and subject (char search),
Row
(
"
subject
"
),
Row
(
"
day_start
"
,
"
day_end
"
),
Row
(
"
absent
"
,
"
excused
"
,
"
excuse_type
"
),
Row
(
"
late__
l
t
"
,
"
late__
g
t
"
,
"
extra_marks
"
)
Row
(
"
late__
g
t
"
,
"
late__
l
t
"
,
"
extra_marks
"
)
)
class
Meta
:
...
...
@@ -23,6 +30,4 @@ class PersonalNoteFilter(FilterSet):
"
absent
"
:
[
'
exact
'
],
"
excuse_type
"
:
[
"
exact
"
],
"
extra_marks
"
:
[
"
exact
"
],
# TODO: "date??": ['lt', 'gt'],
# TODO: "subject??": "exact",
}
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