1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

initial work on config context performance improvements

This commit is contained in:
John Anderson
2020-10-20 01:07:22 -04:00
parent 87c13a876b
commit 3ba18633de
4 changed files with 69 additions and 5 deletions

View File

@ -542,8 +542,11 @@ class ConfigContextModel(models.Model):
# Compile all config data, overwriting lower-weight values with higher-weight values where a collision occurs
data = OrderedDict()
for context in ConfigContext.objects.get_for_object(self):
data = deepmerge(data, context.data)
#for context in ConfigContext.objects.get_for_object(self):
# data = deepmerge(data, context.data)
for context in self.config_contexts:
data = deepmerge(data, context)
# If the object has local config context data defined, merge it last
if self.local_context_data: