mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory and modelformset_factory, and the generic views `ModelFormMixin`, `CreateView` and `UpdateView` which gain a new `fields` attribute.
This commit is contained in:
@@ -229,9 +229,6 @@ class ModelAdminTests(TestCase):
|
||||
class AdminBandForm(forms.ModelForm):
|
||||
delete = forms.BooleanField()
|
||||
|
||||
class Meta:
|
||||
model = Band
|
||||
|
||||
class BandAdmin(ModelAdmin):
|
||||
form = AdminBandForm
|
||||
|
||||
@@ -319,8 +316,7 @@ class ModelAdminTests(TestCase):
|
||||
'</select>' % (band2.id, self.band.id))
|
||||
|
||||
class AdminConcertForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Concert
|
||||
pass
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(AdminConcertForm, self).__init__(*args, **kwargs)
|
||||
@@ -685,9 +681,6 @@ class ValidationTests(unittest.TestCase):
|
||||
class AdminBandForm(forms.ModelForm):
|
||||
delete = forms.BooleanField()
|
||||
|
||||
class Meta:
|
||||
model = Band
|
||||
|
||||
class BandAdmin(ModelAdmin):
|
||||
form = AdminBandForm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user