Skip to content

Conversation

JaeHyuckSa
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

@JaeHyuckSa JaeHyuckSa 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
class Trunc(TruncBase):
def __init__(
self,
expression: Expression,
Copy link
Contributor

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.

3 participants