Răsfoiți Sursa

v3.7 documentation updates

Jeremy Stretch 2 ani în urmă
părinte
comite
8e7146cd06

+ 13 - 0
docs/models/virtualization/virtualdisk.md

@@ -0,0 +1,13 @@
+# Virtual Disks
+
+A virtual disk is used to model discrete virtual hard disks assigned to [virtual machines](./virtualmachine.md).
+
+## Fields
+
+### Name
+
+A human-friendly name that is unique to the assigned virtual machine.
+
+### Size
+
+The allocated disk size, in gigabytes.

+ 4 - 0
docs/plugins/development/models.md

@@ -60,6 +60,10 @@ class MyModel(NetBoxModel):
 
 This attribute specifies the URL at which the documentation for this model can be reached. By default, it will return `/static/docs/models/<app_label>/<model_name>/`. Plugin models can override this to return a custom URL. For example, you might direct the user to your plugin's documentation hosted on [ReadTheDocs](https://readthedocs.org/).
 
+#### `_netbox_private`
+
+By default, any model introduced by a plugin will appear in the list of available object types e.g. when creating a custom field or certain dashboard widgets. If your model is intended only for "behind the scenes use" and should not be exposed to end users, set `_netbox_private` to True. This will omit it from the list of general-purpose object types.
+
 ### Enabling Features Individually
 
 If you prefer instead to enable only a subset of these features for a plugin model, NetBox provides a discrete "mix-in" class for each feature. You can subclass each of these individually when defining your model. (Your model will also need to inherit from Django's built-in `Model` class.)