mirror of
https://github.com/django/django.git
synced 2025-08-30 23:37:50 +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:
parent
1e37cb37ce
commit
f026a519ae
34 changed files with 578 additions and 201 deletions
|
@ -418,6 +418,8 @@ class ModelInheritanceTest(TestCase):
|
|||
class ProfileForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Profile
|
||||
fields = '__all__'
|
||||
|
||||
User.objects.create(username="user_only")
|
||||
p = Profile.objects.create(username="user_with_profile")
|
||||
form = ProfileForm({'username': "user_with_profile", 'extra': "hello"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue