Skip to content
Snippets Groups Projects
Verified Commit 8b8b6ec2 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

[PreferenceLayout] Improve docstrings and fix empty lines

parent 58d7de49
No related branches found
No related tags found
1 merge request!422Resolve "Add option to define rows for preferences forms"
Pipeline #5094 passed
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment