Browse Source

Update docstrings for base form classes

jeremystretch 4 năm trước cách đây
mục cha
commit
bfb1a82754
1 tập tin đã thay đổi với 10 bổ sung3 xóa
  1. 10 3
      netbox/netbox/forms/base.py

+ 10 - 3
netbox/netbox/forms/base.py

@@ -18,7 +18,7 @@ __all__ = (
 
 
 class NetBoxModelForm(BootstrapMixin, CustomFieldsMixin, forms.ModelForm):
 class NetBoxModelForm(BootstrapMixin, CustomFieldsMixin, forms.ModelForm):
     """
     """
-    Base form for creating & editing NetBox models. Adds support for custom fields.
+    Base form for creating & editing NetBox models. Extends Django's ModelForm to add support for custom fields.
 
 
     Attributes:
     Attributes:
         fieldsets: An iterable of two-tuples which define a heading and field set to display per section of
         fieldsets: An iterable of two-tuples which define a heading and field set to display per section of
@@ -65,6 +65,9 @@ class NetBoxModelBulkEditForm(BootstrapMixin, CustomFieldsMixin, BulkEditMixin,
     """
     """
     Base form for modifying multiple NetBox objects (of the same type) in bulk via the UI. Adds support for custom
     Base form for modifying multiple NetBox objects (of the same type) in bulk via the UI. Adds support for custom
     fields and adding/removing tags.
     fields and adding/removing tags.
+
+    Attributes:
+        nullable_fields: A list of field names indicating which fields support being set to null/empty
     """
     """
     add_tags = DynamicModelMultipleChoiceField(
     add_tags = DynamicModelMultipleChoiceField(
         queryset=Tag.objects.all(),
         queryset=Tag.objects.all(),
@@ -100,9 +103,13 @@ class NetBoxModelBulkEditForm(BootstrapMixin, CustomFieldsMixin, BulkEditMixin,
 
 
 class NetBoxModelFilterSetForm(BootstrapMixin, CustomFieldsMixin, forms.Form):
 class NetBoxModelFilterSetForm(BootstrapMixin, CustomFieldsMixin, forms.Form):
     """
     """
-    Base form for FilerSet forms. These are used to filter object lists in the NetBox UI.
+    Base form for FilerSet forms. These are used to filter object lists in the NetBox UI. Note that the
+    corresponding FilterSet *must* provide a `q` filter.
 
 
-    The corresponding FilterSet *must* provide a `q` filter.
+    Attributes:
+        model: The model class associated with the form
+        fieldsets: An iterable of two-tuples which define a heading and field set to display per section of
+            the rendered form (optional). If not defined, the all fields will be rendered as a single section.
     """
     """
     q = forms.CharField(
     q = forms.CharField(
         required=False,
         required=False,