-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Conversation
@@ -21,12 +21,24 @@ class FilteredSelectMultiple(forms.SelectMultiple): | |||
choices: _Choices = ..., | |||
) -> None: ... | |||
|
|||
class AdminDateWidget(forms.DateInput): | |||
class BaseAdminDateWidget(forms.DateInput): | |||
class Media: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
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 addeddjango.contrib.admin.widgets.AdminDateWidget
was changeddjango.contrib.admin.widgets.BaseAdminTimeWidget
was addeddjango.contrib.admin.widgets.AdminTimeWidget
was changeddjango.contrib.admin.widgets.RelatedFieldWidgetWrapper.choices
was addedRelated 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