Skip to content

Commit

Permalink
Update db.models.functions.comparison (#206)
Browse files Browse the repository at this point in the history
Adds the missing functions [`Collate`](https://docs.djangoproject.com/en/4.2/ref/models/database-functions/#collate) and [`JSONObject`](https://docs.djangoproject.com/en/4.2/ref/models/database-functions/#jsonobject) to `db.models.functions.comparison`.

Also makes them available from `db.models.functions`.
  • Loading branch information
noelleleigh authored Oct 21, 2023
1 parent d329629 commit aa3497f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django-stubs/db/models/functions/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .comparison import Cast as Cast
from .comparison import Coalesce as Coalesce
from .comparison import Collate as Collate
from .comparison import Greatest as Greatest
from .comparison import JSONObject as JSONObject
from .comparison import Least as Least
from .comparison import NullIf as NullIf
from .datetime import Extract as Extract
Expand Down
6 changes: 6 additions & 0 deletions django-stubs/db/models/functions/comparison.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class Cast(Func):
) -> None: ...

class Coalesce(Func): ...
class Collate(Func):
def __init__(self, expression: Any, collation: str) -> None: ...

class Greatest(Func): ...
class JSONObject(Func):
def __init__(self, **fields: Any) -> None: ...

class Least(Func): ...
class NullIf(Func): ...

0 comments on commit aa3497f

Please sign in to comment.