Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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-Matrix
Commits
04e892b8
Commit
04e892b8
authored
2 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '33-move-groupfilter-from-core' into 'master'
Resolve "Move GroupFilter from Core" Closes
#33
See merge request
!49
parents
e0e7a8fb
107b8339
No related branches found
Branches containing commit
No related tags found
1 merge request
!49
Resolve "Move GroupFilter from Core"
Pipeline
#194611
passed
2 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Pipeline: AlekSIS
#194614
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/matrix/filters.py
+19
-2
19 additions, 2 deletions
aleksis/apps/matrix/filters.py
with
19 additions
and
2 deletions
aleksis/apps/matrix/filters.py
+
19
−
2
View file @
04e892b8
from
aleksis.core.filters
import
GroupFilter
from
django.utils.translation
import
gettext
as
_
from
django_filters
import
ModelChoiceFilter
,
ModelMultipleChoiceFilter
from
material
import
Layout
,
Row
class
GroupMatrixRoomFilter
(
GroupFilter
):
from
aleksis.core.filters
import
MultipleCharFilter
from
aleksis.core.models
import
Group
,
GroupType
,
SchoolTerm
class
GroupMatrixRoomFilter
:
"""
Custom filter for groups on Matrix room overview.
"""
school_term
=
ModelChoiceFilter
(
queryset
=
SchoolTerm
.
objects
.
all
())
group_type
=
ModelChoiceFilter
(
queryset
=
GroupType
.
objects
.
all
())
parent_groups
=
ModelMultipleChoiceFilter
(
queryset
=
Group
.
objects
.
all
())
search
=
MultipleCharFilter
([
"
name__icontains
"
,
"
short_name__icontains
"
],
label
=
_
(
"
Search
"
))
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
form
.
layout
=
Layout
(
Row
(
"
search
"
),
Row
(
"
school_term
"
,
"
group_type
"
,
"
parent_groups
"
))
self
.
form
.
initial
=
{
"
school_term
"
:
SchoolTerm
.
current
}
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