Handle all associations

This commit is contained in:
Aleksandar Radunovic
2018-10-16 11:05:28 +02:00
parent 6cc4c67387
commit b53e886f8f
8 changed files with 156 additions and 65 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ with open('/opt/netbox/initializers/manufacturers.yml', 'r') as stream:
manufacturers = yaml.load(stream)
if manufacturers is not None:
for manufacturer_params in manufacturers:
manufacturer, created = Manufacturer.objects.get_or_create(**manufacturer_params)
for params in manufacturers:
manufacturer, created = Manufacturer.objects.get_or_create(**params)
if created:
print("Created Manufacturer", manufacturer.name)
print("Created Manufacturer", manufacturer.name)