(self, request, *args, **kwargs)
| 19 | return super().dispatch(*args, **kwargs) |
| 20 | |
| 21 | def get(self, request, *args, **kwargs): |
| 22 | connection_id = kwargs.get("connection", default_db_connection_id()) |
| 23 | try: |
| 24 | connection = DatabaseConnection.objects.get(id=connection_id) |
| 25 | except DatabaseConnection.DoesNotExist as e: |
| 26 | raise Http404 from e |
| 27 | except ValueError as e: |
| 28 | raise Http404 from e |
| 29 | schema = schema_info(connection) |
| 30 | if schema: |
| 31 | return render( |
| 32 | request, |
| 33 | "explorer/schema.html", |
| 34 | {"schema": schema} |
| 35 | ) |
| 36 | else: |
| 37 | return render(request, |
| 38 | "explorer/schema_error.html", |
| 39 | {"connection": connection.alias}) |
| 40 | |
| 41 | |
| 42 | class SchemaJsonView(PermissionRequiredMixin, View): |
no test coverage detected