def get_context_data(self, **kwargs): # call get_context_data on super (project.instances) to # retrieve the context data and set necessary context attributes. # Overwrite "actions" context attribute with admin.instances table # row actions so that the actions in Admin instances table for the # selected entry are reflected in the detail view. context = super(DetailView, self).get_context_data(**kwargs) instance = self.get_data() table = project_tables.AdminInstancesTable(self.request) context["actions"] = table.render_row_actions(instance) return context
def _get_actions(self, instance): table = project_tables.AdminInstancesTable(self.request) return table.render_row_actions(instance)