How to get assigned nameserver of Zone model #117
-
Hi, I am trying to implement similar feature to "IP coupling". When selecting Zone object in netbox suctom script, it does not include related nameservers. How I could get related Nemeservers to specific zone?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are using
If you want to stick with the
Note that |
Beta Was this translation helpful? Give feedback.
You are using
values()
, which unpacks theZone
object to a dict, and loses all related objects. What you need, however, is the object.If you want to stick with the
filter()
expression that would beNote that
get()
andfind()
behave differently for non-existing objects:find()
returns an emptyQuerySet
whileget()
raises aDoesNotExist
exception you need to handle.