Skip to main content

Language Server Protocol implementation for Django ORM operations

Project description

Django ORM Language Server Protocol (LSP)

CI

A Language Server Protocol implementation for Django ORM that provides intelligent autocompletion for model queries, field lookups, and related field navigation.

Features

  • Smart Completions: Field lookups (__exact, __contains, __startswith) and related field navigation (user__profile__bio)
  • Multi-App Support: Works with Django projects that have multiple apps
  • Django Integration: Uses Django's built-in field lookup APIs

Installation

pip install django-qs-lsp

Usage

Running the Server

django-qs-lsp-server

Neovim Setup

  1. Install via Mason:

    :MasonInstall django-qs-lsp
    
  2. Configure LSPConfig:

    require("lspconfig").django_qs_lsp.setup({
      filetypes = { "python" },
      root_dir = require("lspconfig.util").root_pattern("manage.py"),
    })
    

Supported Contexts

The LSP provides completions for:

  • Model.objects.filter(...)
  • Model.objects.exclude(...)
  • Model.objects.get(...)
  • Model.objects.annotate(...)
  • Model.objects.order_by(...)

Example

from django.contrib.auth.models import User

# Field completions
User.objects.filter(username  # Suggests: username=
User.objects.filter(email__   # Suggests: email__exact, email__contains, etc.

# Related field completions
User.objects.filter(profile__  # Suggests: profile__bio, profile__user, etc.

Configuration

# Debug logging
export DJANGO_QS_LSP_DEBUG=true

Development

# Install dependencies
pip install -e ".[dev]"

# Run tests
python -m pytest tests/ -v

# Code quality
ruff check .
mypy src/django_lsp/

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_qs_lsp-1.4.5.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_qs_lsp-1.4.5-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file django_qs_lsp-1.4.5.tar.gz.

File metadata

  • Download URL: django_qs_lsp-1.4.5.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_qs_lsp-1.4.5.tar.gz
Algorithm Hash digest
SHA256 c6ca1dcf9014f4e98ab5da1b7bcc64154a68f9e99eca76d6b3c9c43f81ca2d47
MD5 d38de5cc6ff51c5ff8a79e38820590fd
BLAKE2b-256 d756a97d80e7f4c50be4dd3416b65a25fd26da0c4de0b25fd7f254bf3147edf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_qs_lsp-1.4.5.tar.gz:

Publisher: publish.yml on JBSK8NC/django-lsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_qs_lsp-1.4.5-py3-none-any.whl.

File metadata

  • Download URL: django_qs_lsp-1.4.5-py3-none-any.whl
  • Upload date:
  • Size: 52.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_qs_lsp-1.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4012d164938ecaa7a75146ebd941e6f4f76dd6756021e5b4874dd4d09c0329a1
MD5 756cba933d80145c6900c89186200a58
BLAKE2b-256 cc489b73275f1d0db7c1325d399a41ad7472f4ee92687ab7e403d8b95705b69a

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_qs_lsp-1.4.5-py3-none-any.whl:

Publisher: publish.yml on JBSK8NC/django-lsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page