Skip to content

python: a class-based view routed with .as_view() has no url entry point #1513

Closed

Description

@swapnilpaliwal-sd

Symptom

On 0.1.3 (0df257c) a class-based view routed with .as_view() has no url entry point: none of its handler methods is one, and impact on OrderView.get lists only an [alongside] sibling and calls the change local. A function view in the same table is an entry point. The MCP axiomcode_impact tool prints the same.

Reproduction (with an empty app/__init__.py)

# app/views.py
from django.views import View


class OrderView(View):
    def get(self, request):
        return "orders"


def order_list(request):
    return "list"
# app/urls.py
from django.urls import path
from . import views
urlpatterns = [
    path("orders/", views.order_list),
    path("orders/view/", views.OrderView.as_view()),
]
$ axiomcode index
$ sqlite3 .axiomcode/out/graph.sqlite "SELECT m.qualified_name, e.c1 FROM ext_entry_point e JOIN methods m ON m.id = e.c0"
app.views.order_list|url
$ axiomcode impact OrderView.get
reads or uses it (1 callable(s): 1 alongside):
    [alongside] OrderView.<classbody>   app/views.py:4 ...
next: nothing resolved depends on it, so the change is local ...

Root cause

graph/python/engine/framework-behavior/dispatch.dl:280-283 takes the view as an argument of the route entry that expr_denotes_method resolves to a def. views.OrderView.as_view() is a call to the framework's as_view, which denotes no client method, so the entry joins nothing. No rule maps the class named as the receiver of as_view() to its HTTP-verb methods.

Expected: OrderView.get is a url entry point with a url_dispatch edge from urls.py, like order_list.

Activity

  1. swapnilpaliwal-sd commented on Sep 28, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1633.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineResolution / call-graph engine rulesenhancementNew feature or requestpythonPython

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions