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:
@@ -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 #######################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user