mirror of
https://github.com/django/django.git
synced 2025-08-19 02:01:29 +00:00
Fixed #10069 -- Fixed the model form unique validation code to not proceed with using, for example, RelatedObjects returned by get_field_by_name as though they were model Fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9c6efb2eea
commit
795c229ae9
2 changed files with 18 additions and 1 deletions
|
@ -193,6 +193,17 @@ Extra fields.
|
|||
>>> CategoryForm.base_fields.keys()
|
||||
['name', 'slug', 'url', 'some_extra_field']
|
||||
|
||||
Extra field that has a name collision with a related object accessor.
|
||||
|
||||
>>> class WriterForm(ModelForm):
|
||||
... book = forms.CharField(required=False)
|
||||
...
|
||||
... class Meta:
|
||||
... model = Writer
|
||||
|
||||
>>> wf = WriterForm({'name': 'Richard Lockridge'})
|
||||
>>> wf.is_valid()
|
||||
True
|
||||
|
||||
Replacing a field.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue