mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +00:00
Fixed #13138: Ensure required=False on a model form field overrides
blank=False on the underlying model field during model form clean, in order to maintain backward compatibility. Thanks to saxon75 for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from django.forms import ModelForm
|
||||
|
||||
from models import Product, Price, Book, DerivedBook, ExplicitPK, Post, DerivedPost
|
||||
from models import Product, Price, Book, DerivedBook, ExplicitPK, Post, DerivedPost, Writer
|
||||
|
||||
class ProductForm(ModelForm):
|
||||
class Meta:
|
||||
@@ -30,3 +31,9 @@ class PostForm(ModelForm):
|
||||
class DerivedPostForm(ModelForm):
|
||||
class Meta:
|
||||
model = DerivedPost
|
||||
|
||||
class CustomWriterForm(ModelForm):
|
||||
name = forms.CharField(required=False)
|
||||
|
||||
class Meta:
|
||||
model = Writer
|
||||
|
||||
Reference in New Issue
Block a user