Quellcode durchsuchen

Update docstrings for base form classes

jeremystretch vor 4 Jahren
Ursprung
Commit
bfb1a82754
1 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen
  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,