mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Cache custom fields on instance prior to calling create()/update()
This commit is contained in:
@@ -17,11 +17,14 @@ from extras.utils import FeatureQuery
|
||||
#
|
||||
|
||||
class CustomFieldModel(models.Model):
|
||||
_cf = None
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
def __init__(self, *args, custom_fields=None, **kwargs):
|
||||
self._cf = custom_fields
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def cache_custom_fields(self):
|
||||
"""
|
||||
Cache all custom field values for this instance
|
||||
|
||||
Reference in New Issue
Block a user