Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stubs for django.contrib.postgres.expressions #1765

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions django-stubs/contrib/postgres/expressions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import Any

from django.contrib.postgres.fields import ArrayField
from django.db.models import Subquery
from django.db.models.query import QuerySet
from django.db.models.sql.query import Query
from django.utils.functional import cached_property

class ArraySubquery(Subquery):
template: str

def __init__(self, queryset: Query | QuerySet[Any], **kwargs: Any) -> None: ...
@cached_property
def output_field(self) -> ArrayField: ...
flaeppe marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ django.contrib.gis.forms.BaseForm.changed_data
django.contrib.gis.forms.BaseFormSet.forms
django.contrib.gis.forms.BaseFormSet.management_form
django.contrib.gis.forms.BoundField.subwidgets
django.contrib.postgres.expressions.ArraySubquery.output_field
django.core.files.File.size
django.core.files.base.File.size
django.core.files.storage.FileSystemStorage.base_location
Expand Down