2010-03-18 02:03:07 +00:00
|
|
|
from django import forms
|
2010-03-16 19:32:11 +00:00
|
|
|
from django.forms import ModelForm
|
|
|
|
|
2011-01-09 13:26:39 +00:00
|
|
|
from models import (Product, Price, Book, DerivedBook, ExplicitPK, Post,
|
|
|
|
DerivedPost, Writer, FlexibleDatePost)
|
2010-03-16 19:32:11 +00:00
|
|
|
|
|
|
|
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
|
2010-03-18 02:03:07 +00:00
|
|
|
|
|
|
|
class CustomWriterForm(ModelForm):
|
|
|
|
name = forms.CharField(required=False)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Writer
|
2011-01-09 13:26:39 +00:00
|
|
|
|
|
|
|
class FlexDatePostForm(ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = FlexibleDatePost
|