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.contrib.admin.widgets #2105

Merged
merged 4 commits into from May 8, 2024

Conversation

saJaeHyukc
Copy link
Contributor

I have made things!

Update stubs for django.contrib.admin.widgets for Django 5.0.

  • django.contrib.admin.widgets
    • django.contrib.admin.widgets.BaseAdminDateWidget was added
    • django.contrib.admin.widgets.AdminDateWidget was changed
    • django.contrib.admin.widgets.BaseAdminTimeWidget was added
    • django.contrib.admin.widgets.AdminTimeWidget was changed
    • django.contrib.admin.widgets.RelatedFieldWidgetWrapper.choices was added

Related issues

Refs

Upstream PR
django.contrib.admin.widgets.RelatedFieldWidgetWrapper.choices

django.contrib.admin.widgets.BaseAdminDateWidget
django.contrib.admin.widgets.AdminDateWidget
django.contrib.admin.widgets.BaseAdminTimeWidget
django.contrib.admin.widgets.AdminTimeWidget

@sudosubin sudosubin mentioned this pull request May 2, 2024
39 tasks
@@ -21,12 +21,24 @@ class FilteredSelectMultiple(forms.SelectMultiple):
choices: _Choices = ...,
) -> None: ...

class AdminDateWidget(forms.DateInput):
class BaseAdminDateWidget(forms.DateInput):
class Media:
Copy link
Member

Choose a reason for hiding this comment

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

CC @flaeppe

I think that defining such classes may cause an error when defining subclasses of widgets.

It is close to out Meta case.

Copy link
Contributor Author

@saJaeHyukc saJaeHyukc May 8, 2024

Choose a reason for hiding this comment

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

@sobolvn I get an error in stustest if I delete that Media case. What should I do about this??

error: django.contrib.admin.widgets.BaseAdminDateWidget.Media is not present in stub
Stub: in file /Users/sajh/Documents/project/django-stubs/django-stubs/contrib/admin/widgets.pyi
MISSING
Runtime: in file /Users/sajh/.pyenv/versions/3.11.5/lib/python3.11/site-packages/django/contrib/admin/widgets.py:53
def ()

error: django.contrib.admin.widgets.BaseAdminTimeWidget.Media is not present in stub
Stub: in file /Users/sajh/Documents/project/django-stubs/django-stubs/contrib/admin/widgets.pyi
MISSING
Runtime: in file /Users/sajh/.pyenv/versions/3.11.5/lib/python3.11/site-packages/django/contrib/admin/widgets.py:69
def ()

Should I not delete that part?

Copy link
Member

Choose a reason for hiding this comment

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

Let's ignore it for now, we can later decide what to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I revised what you said :)

@sobolevn sobolevn merged commit 059e8f6 into typeddjango:master May 8, 2024
36 checks passed
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

2 participants