mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Removed redundant QuerySet.all() calls in docs and tests.
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
This commit is contained in:
parent
7ba6ebe914
commit
847f46e9bf
47 changed files with 184 additions and 209 deletions
|
|
@ -1617,7 +1617,7 @@ class ModelFormBasicTests(TestCase):
|
|||
# Set up a callable initial value
|
||||
def formfield_for_dbfield(db_field, **kwargs):
|
||||
if db_field.name == "categories":
|
||||
kwargs["initial"] = lambda: Category.objects.all().order_by("name")[:2]
|
||||
kwargs["initial"] = lambda: Category.objects.order_by("name")[:2]
|
||||
return db_field.formfield(**kwargs)
|
||||
|
||||
# Create a ModelForm, instantiate it, and check that the output is as expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue