Skip to content

Device Model


Bases: DeviceCommonFieldsName, SaveHistory

Attributes

reserved_config_keys: list = ['software']

name = models.CharField(blank=False, max_length=50, unique=True, validators=[validate_hostname_format])

serial_number = models.CharField(verbose_name='Serial Number', max_length=50, default=None, null=True, blank=True, unique=True, help_text='Serial number of the device.')

uuid = models.CharField(verbose_name='UUID', max_length=50, default=None, null=True, blank=True, unique=True, help_text='System GUID/UUID.', validators=[validate_uuid_format])

device_model = models.ForeignKey(DeviceModel, on_delete=models.CASCADE, default=None, null=True, blank=True, help_text='Model of the device.')

device_type = models.ForeignKey(DeviceType, on_delete=models.CASCADE, default=None, null=True, blank=True, help_text='Type of device.')

config = models.JSONField(blank=True, default=None, null=True, validators=[validate_config_keys_not_reserved], verbose_name='Host Configuration', help_text='Configuration for this device')

inventorydate = models.DateTimeField(verbose_name='Last Inventory Date', null=True, blank=True)

is_virtual = models.BooleanField(blank=True, default=False, help_text='Is this device a virtual machine', null=False, verbose_name='Is Virtual')

status: str

Fetch Device status

Returns:

Name Type Description
str str

Current status of the item

Classes

Meta

Attributes

verbose_name_plural = 'Devices'

Functions

validate_config_keys_not_reserved()

validate_uuid_format()

validate_hostname_format()

save(force_insert=False, force_update=False, using=None, update_fields=None)

Save Device Model

After saving the device update the related items so that they are a part of the same organization as the device.

__str__()

get_configuration(id)

About:

This page forms part of our Project Centurion ERP.

Page Metadata
Version: ToDo: place files short git commit here
Date Created: 2024-06-16
Date Edited: 2024-07-13

Contribution:

Would You like to contribute to our Centurion ERP project? You can assist in the following ways:

 

ToDo: Add the page list of contributors