Cleaned up some stray text in the test from r11874. Thanks to Rob Hudson for the eagle eyes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
680268a683
commit
4e81086021
|
@ -646,7 +646,7 @@ True
|
||||||
|
|
||||||
We can provide a custom queryset to our InlineFormSet:
|
We can provide a custom queryset to our InlineFormSet:
|
||||||
|
|
||||||
>>> custom_qs = queryset=Book.objects.order_by('-title')
|
>>> custom_qs = Book.objects.order_by('-title')
|
||||||
>>> formset = AuthorBooksFormSet(instance=author, queryset=custom_qs)
|
>>> formset = AuthorBooksFormSet(instance=author, queryset=custom_qs)
|
||||||
>>> for form in formset.forms:
|
>>> for form in formset.forms:
|
||||||
... print form.as_p()
|
... print form.as_p()
|
||||||
|
@ -672,7 +672,7 @@ We can provide a custom queryset to our InlineFormSet:
|
||||||
>>> formset.is_valid()
|
>>> formset.is_valid()
|
||||||
True
|
True
|
||||||
|
|
||||||
>>> custom_qs = queryset=Book.objects.filter(title__startswith='F')
|
>>> custom_qs = Book.objects.filter(title__startswith='F')
|
||||||
>>> formset = AuthorBooksFormSet(instance=author, queryset=custom_qs)
|
>>> formset = AuthorBooksFormSet(instance=author, queryset=custom_qs)
|
||||||
>>> for form in formset.forms:
|
>>> for form in formset.forms:
|
||||||
... print form.as_p()
|
... print form.as_p()
|
||||||
|
|
Loading…
Reference in New Issue