Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
8b8b6ec2
Verified
Commit
8b8b6ec2
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
[PreferenceLayout] Improve docstrings and fix empty lines
parent
58d7de49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!422
Resolve "Add option to define rows for preferences forms"
Pipeline
#5094
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/util/forms.py
+6
-7
6 additions, 7 deletions
aleksis/core/util/forms.py
with
6 additions
and
7 deletions
aleksis/core/util/forms.py
+
6
−
7
View file @
8b8b6ec2
...
...
@@ -4,20 +4,19 @@ from material import Layout, Row
class
PreferenceLayout
(
Layout
):
"""
Create a django-material Layout object for the given form_base_class.
:param form_base_class: A Form class used as the base. Must have a ``registry` attribute
:param section: A section where the layout builder will load preferences
"""
"""
django-material Layout object for managing preferences.
"""
def
__init__
(
self
,
form_base_class
,
section
=
None
):
"""
Create Layout object for the given form_base_class.
:param form_base_class: A Form class used as the base. Must have a ``registry` attribute
:param section: A section where the layout builder will load preferences
"""
registry
=
form_base_class
.
registry
if
section
:
# Try to use section param
preferences_obj
=
registry
.
preferences
(
section
=
section
)
else
:
# display all preferences in the form
preferences_obj
=
registry
.
preferences
()
...
...
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