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

5.0: Update django.db.models.functions.datetime #2167

Merged
merged 1 commit into from
May 19, 2024

Conversation

saJaeHyukc
Copy link
Contributor

I have made things!

Update stubs for django.db.models.functions.datetime for Django 5.0.

  • django.db.models.functions.datetime
    • django.db.models.functions.datetime.TruncBase.__init__'s is_dst argument was removed
    • django.db.models.functions.datetime.TruncBase.is_dst was removed
    • django.db.models.functions.datetime.Trunc.__init__'s is_dst argument was removed

I have added the necessary __init__ and as_sql methods to accommodate the updates in Django 5.0.

Related issues

Refs

Upstream PR

@saJaeHyukc saJaeHyukc mentioned this pull request May 16, 2024
39 tasks
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sobolevn sobolevn merged commit bcd4bfd into typeddjango:master May 19, 2024
36 checks passed
class Trunc(TruncBase):
def __init__(
self,
expression: Expression,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the types on expression do not match django.db.expressions.Func which currently has this typed as Any -- notably these expressions go through parsing and (at the very least) accept str as well

asottile added a commit to asottile/django-stubs that referenced this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants