Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
podliashanyk committed Sep 27, 2024
1 parent ed79abd commit 8cbf2ce
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions python/nav/web/crispyforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,30 @@ def __init__(self, legend, fields: list, css_class=''):


class FormRow:
"""A class representing a row in a form layout.
Row is not a functional element in forms, but a visual one.
:param fields: A list of fields to include in the row.
:param css_classes: Additional CSS classes to apply to the row. Defaults to an empty string.
"""

def __init__(self, fields: list, css_classes: str = ''):
"""Constructor method"""
self.fields = fields
self.css_classes = css_classes
self.template = 'custom_crispy_templates/form_row.html'


class FormColumn:
"""A class representing a column in a form layout.
Column is not a functional element in forms, but a visual one.
:param fields: A list of fields to include in the column.
:param css_classes: Additional CSS classes to apply to the column. Defaults to an empty string.
"""

def __init__(self, fields: list, css_classes: str = ''):
"""Constructor method"""
self.fields = fields
self.css_classes = css_classes
self.template = 'custom_crispy_templates/form_column.html'
Expand Down

0 comments on commit 8cbf2ce

Please sign in to comment.