Skip to content

Inherit Script class #17040

Answered by candlerb
rizlas asked this question in Help Wanted!
Discussion options

You must be logged in to vote

Try using a Mixin instead of subclassing.

class CustomScriptMixin:
    ...

class BestScript(Script, CustomScriptMixin):
    ...

Plenty of examples of this in the Netbox core code - just search for the text Mixin. I'm not sure if nice_flag would be picked up this way though, and if not, you might need to use a subclassing hook.

Replies: 2 comments

Comment options

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

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants