Skip to content

Commit a261d70

Browse files
committed
feat: handle Subscripts (slice in queries)
1 parent 66fb11a commit a261d70

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/django-check/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "django-check"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
rust-version = { workspace = true }
55
license = { workspace = true }
66
authors = { workspace = true }

crates/django-check/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "djch"
7-
version = "0.1.2"
7+
version = "0.1.3"
88
description = "Static N+1 query detector for Django ORM – fast Rust-powered checker"
99
# For PyPI long description (shows formatted on project page)
1010
readme = {file = "README.md", content-type = "text/markdown"}

crates/django-check_semantic/src/passes/n_plus_one.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ impl<'a> QuerySetResolver<'a> {
8383
Expr::Call(call) => self.resolve_call(call),
8484
Expr::Attribute(attr) => self.resolve_attribute(attr),
8585
Expr::Name(name) => self.symbols.lookup(&name.id).cloned(),
86+
// Handle slice like myqueryset[0:100]
87+
Expr::Subscript(subscript) => self.resolve(&subscript.value),
8688
_ => None,
8789
}
8890
}

0 commit comments

Comments
 (0)