Add tags example to custom scripts documentation

This commit is contained in:
ryanmerolle 2020-03-26 12:32:49 -04:00
parent 66a99e13bb
commit 56a3620627

View File

@ -237,6 +237,7 @@ class NewBranchScript(Script):
status=SiteStatusChoices.STATUS_PLANNED
)
site.save()
site.tags.add("colo", "test") # Unlike other object attributes, any time you want to add tags to an object, you must do so AFTER the object has been saved.
self.log_success("Created new site: {}".format(site))
# Create access switches