Skip to content

Add ORM query autocomplete inside .filter() / .exclude() / .annotate() #3

Description

@FROWNINGdev

This is the moat feature identified in competitor analysis: no shipped Django extension does ORM query autocomplete well.

Goal: when the user types inside Post.objects.filter(...), complete field names based on the parsed model index, and resolve lookups like author__name through FK edges.

Design sketch:

  1. Detect .filter( / .exclude( / .annotate( call inside a Python file via lightweight regex or textDocument context.
  2. Resolve the QuerySet's base model from the assignment chain (best-effort).
  3. Suggest field names + __lookup traversal from the parsed WorkspaceIndex.
  4. Warn on typos with a diagnostic.

Prior art: the archived django-intellisense extension had a partial implementation worth studying.

Bigger feature — likely v0.5+. Design discussion welcome on Discussions first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions