mirror of
https://github.com/django/django.git
synced 2024-12-27 11:35:53 +00:00
7471dab660
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
40 lines
805 B
Python
Executable File
40 lines
805 B
Python
Executable File
from django import forms
|
|
from django.forms import ModelForm
|
|
|
|
from models import Product, Price, Book, DerivedBook, ExplicitPK, Post, DerivedPost, Writer
|
|
|
|
class ProductForm(ModelForm):
|
|
class Meta:
|
|
model = Product
|
|
|
|
class PriceForm(ModelForm):
|
|
class Meta:
|
|
model = Price
|
|
|
|
class BookForm(ModelForm):
|
|
class Meta:
|
|
model = Book
|
|
|
|
class DerivedBookForm(ModelForm):
|
|
class Meta:
|
|
model = DerivedBook
|
|
|
|
class ExplicitPKForm(ModelForm):
|
|
class Meta:
|
|
model = ExplicitPK
|
|
fields = ('key', 'desc',)
|
|
|
|
class PostForm(ModelForm):
|
|
class Meta:
|
|
model = Post
|
|
|
|
class DerivedPostForm(ModelForm):
|
|
class Meta:
|
|
model = DerivedPost
|
|
|
|
class CustomWriterForm(ModelForm):
|
|
name = forms.CharField(required=False)
|
|
|
|
class Meta:
|
|
model = Writer
|