Skip to content

Inherit Script class #17040

Answered by candlerb
rizlas asked this question in Help Wanted!
Jul 31, 2024 · 2 comments · 1 reply
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 1 reply

Comment options

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

You must be logged in to vote
1 reply
@dga-nagra
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants