Skip to content
Discussion options

You must be logged in to vote

I will try to make a full public example later, the rough steps for now (this is for Prefix but anyway):

Template:

{% extends 'generic/object.html' %}

{% block content %}
My content
{% endblock content %}

View:

@register_model_view(Prefix, name="mytab")
class HelloWorldView(View):
    tab = ViewTab(
        label="My Tab",
        permission="ipam.view_prefix",
    )

    def get(self, request, pk):
        prefix = Prefix.objects.get(pk=pk)
        return render(
            request,
            "my_plugin/tab.html",
            {
                "object": prefix,
                "tab": self.tab,
            },
        )

Comments:

  • context["object"] is needed to be able to populate the …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@ziggekatten
Comment options

@candlerb
Comment options

@markkuleinio
Comment options

@markkuleinio
Comment options

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