mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-10 01:28:16 -06:00
Add tags example to custom scripts documentation
This commit is contained in:
parent
66a99e13bb
commit
56a3620627
@ -237,6 +237,7 @@ class NewBranchScript(Script):
|
|||||||
status=SiteStatusChoices.STATUS_PLANNED
|
status=SiteStatusChoices.STATUS_PLANNED
|
||||||
)
|
)
|
||||||
site.save()
|
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))
|
self.log_success("Created new site: {}".format(site))
|
||||||
|
|
||||||
# Create access switches
|
# Create access switches
|
||||||
|
Loading…
Reference in New Issue
Block a user