diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.8.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 7f8005088a..f1960304c4 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -681,6 +681,24 @@ lookups:: ... ValueError: Cannot query "<Book: Django>": Must be "Author" instance. +``select_related()`` now checks given fields +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``select_related()`` now validates that the given fields actually exist. +Previously, nonexistent fields were silently ignored. Now, an error is raised:: + + >>> book = Book.objects.select_related('nonexistent_field') + Traceback (most recent call last): + ... + FieldError: Invalid field name(s) given in select_related: 'nonexistent_field' + +The validation also makes sure that the given field is relational:: + + >>> book = Book.objects.select_related('name') + Traceback (most recent call last): + ... + FieldError: Non-relational field given in select_related: 'name' + Default ``EmailField.max_length`` increased to 254 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
