Skip to content

How to interact with Nautobot objects in jobs #3298

Answered by jdrew82
phoenixswiss asked this question in Q&A
Discussion options

You must be logged in to vote

Is there something missing from the Jobs documentation? There are example Jobs provided towards the bottom. As you can see in the examples, you're absolutely welcome to use the standard Django ORM methods such as create, delete, etc. It would actually be advised to use those methods as you will have the best performance when interacting with the backend database using them. The one thing to be aware of though is that it's advised to use the validated_save() function when saving objects instead of the typical Django save() method. This enables validation of the object at creation time to ensure it's being created correctly and isn't missing any field data.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by phoenixswiss
Comment options

You must be logged in to vote
3 replies
@jathanism
Comment options

@glennmatthews
Comment options

@phoenixswiss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants