1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Changed ModelForms to allow inheritance as long as their model attributes are the same.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans
2007-12-13 03:14:31 +00:00
parent e415eff0ea
commit 4c59ca6020
2 changed files with 12 additions and 6 deletions

View File

@@ -143,7 +143,7 @@ familiar with the mechanics.
... model = Article
Traceback (most recent call last):
...
ImproperlyConfigured: BadForm defines more than one model.
ImproperlyConfigured: BadForm defines a different model than its parent.
>>> class ArticleForm(ModelForm):
... class Meta:
@@ -155,6 +155,12 @@ Traceback (most recent call last):
...
ImproperlyConfigured: BadForm's base classes define more than one model.
This one is OK since the subclass specifies the same model as the parent.
>>> class SubCategoryForm(CategoryForm):
... class Meta:
... model = Category
# Old form_for_x tests #######################################################