diff --git a/404.html b/404.html index 7dd3f5fd2e..677af73ac6 100644 --- a/404.html +++ b/404.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/authentication/index.html b/api-guide/authentication/index.html index af64836ffe..30f104718f 100644 --- a/api-guide/authentication/index.html +++ b/api-guide/authentication/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/caching/index.html b/api-guide/caching/index.html index 6417edca97..8dd2e11892 100644 --- a/api-guide/caching/index.html +++ b/api-guide/caching/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/content-negotiation/index.html b/api-guide/content-negotiation/index.html index 3157ba3af5..b09f6ed9a6 100644 --- a/api-guide/content-negotiation/index.html +++ b/api-guide/content-negotiation/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/exceptions/index.html b/api-guide/exceptions/index.html index cc955e7a44..213fc1afe2 100644 --- a/api-guide/exceptions/index.html +++ b/api-guide/exceptions/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/fields/index.html b/api-guide/fields/index.html index a6aa67ced8..acf810963a 100644 --- a/api-guide/fields/index.html +++ b/api-guide/fields/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • @@ -836,7 +840,7 @@

    DecimalFieldmin_value Validate that the number provided is no less than this value.
  • localize Set to True to enable localization of input and output based on the current locale. This will also force coerce_to_string to True. Defaults to False. Note that data formatting is enabled if you have set USE_L10N=True in your settings file.
  • rounding Sets the rounding mode used when quantizing to the configured precision. Valid values are decimal module rounding modes. Defaults to None.
  • -
  • normalize_output Will normalize the decimal value when serialized. This will strip all trailing zeroes and change the value's precision to the minimum required precision to be able to represent the value without loosing data. Defaults to False.
  • +
  • normalize_output Will normalize the decimal value when serialized. This will strip all trailing zeroes and change the value's precision to the minimum required precision to be able to represent the value without losing data. Defaults to False.
  • Example usage

    To validate numbers up to 999 with a resolution of 2 decimal places, you would use:

    diff --git a/api-guide/filtering/index.html b/api-guide/filtering/index.html index d831ba530e..84d05e5365 100644 --- a/api-guide/filtering/index.html +++ b/api-guide/filtering/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/format-suffixes/index.html b/api-guide/format-suffixes/index.html index 1841f3e66b..5cc05c2213 100644 --- a/api-guide/format-suffixes/index.html +++ b/api-guide/format-suffixes/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/generic-views/index.html b/api-guide/generic-views/index.html index f319152dd5..4d1eaf3cb2 100644 --- a/api-guide/generic-views/index.html +++ b/api-guide/generic-views/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/metadata/index.html b/api-guide/metadata/index.html index b78344c11c..ca7352da85 100644 --- a/api-guide/metadata/index.html +++ b/api-guide/metadata/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/pagination/index.html b/api-guide/pagination/index.html index 89fde29fda..ee262e5479 100644 --- a/api-guide/pagination/index.html +++ b/api-guide/pagination/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/parsers/index.html b/api-guide/parsers/index.html index 969eb0c103..0bdd67cd47 100644 --- a/api-guide/parsers/index.html +++ b/api-guide/parsers/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/permissions/index.html b/api-guide/permissions/index.html index 34cae0f5bd..c9ab6ad65d 100644 --- a/api-guide/permissions/index.html +++ b/api-guide/permissions/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/relations/index.html b/api-guide/relations/index.html index b4cd27a8a4..00ee55a1ad 100644 --- a/api-guide/relations/index.html +++ b/api-guide/relations/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/renderers/index.html b/api-guide/renderers/index.html index 10de410644..da751cd4cb 100644 --- a/api-guide/renderers/index.html +++ b/api-guide/renderers/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/requests/index.html b/api-guide/requests/index.html index 405c1eef84..5083122268 100644 --- a/api-guide/requests/index.html +++ b/api-guide/requests/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/responses/index.html b/api-guide/responses/index.html index cc4a1be22f..d36f96b211 100644 --- a/api-guide/responses/index.html +++ b/api-guide/responses/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/reverse/index.html b/api-guide/reverse/index.html index 2d9a141d57..fd50c09239 100644 --- a/api-guide/reverse/index.html +++ b/api-guide/reverse/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/routers/index.html b/api-guide/routers/index.html index 7e91d60246..e05f9ddf18 100644 --- a/api-guide/routers/index.html +++ b/api-guide/routers/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/schemas/index.html b/api-guide/schemas/index.html index c05e8c3d57..91c5cb3fff 100644 --- a/api-guide/schemas/index.html +++ b/api-guide/schemas/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/serializers/index.html b/api-guide/serializers/index.html index 22962bf031..feb2cb58e8 100644 --- a/api-guide/serializers/index.html +++ b/api-guide/serializers/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/settings/index.html b/api-guide/settings/index.html index f9757fe131..70dca17f67 100644 --- a/api-guide/settings/index.html +++ b/api-guide/settings/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/status-codes/index.html b/api-guide/status-codes/index.html index 841d9413be..b14bb86554 100644 --- a/api-guide/status-codes/index.html +++ b/api-guide/status-codes/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/testing/index.html b/api-guide/testing/index.html index 79c0cae2c5..9c1ff0d0e7 100644 --- a/api-guide/testing/index.html +++ b/api-guide/testing/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/throttling/index.html b/api-guide/throttling/index.html index 505dda129b..f232d7fea2 100644 --- a/api-guide/throttling/index.html +++ b/api-guide/throttling/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/validators/index.html b/api-guide/validators/index.html index ee069f6208..dd87472744 100644 --- a/api-guide/validators/index.html +++ b/api-guide/validators/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • @@ -634,12 +638,9 @@

    github discussion.


    Advanced field defaults

    -

    Validators that are applied across multiple fields in the serializer can sometimes require a field input that should not be provided by the API client, but that is available as input to the validator.

    -

    Two patterns that you may want to use for this sort of validation include:

    - +

    Validators that are applied across multiple fields in the serializer can sometimes require a field input that should not be provided by the API client, but that is available as input to the validator. +For this purposes use HiddenField. This field will be present in validated_data but will not be used in the serializer output representation.

    +

    Note: Using a read_only=True field is excluded from writable fields so it won't use a default=… argument. Look 3.8 announcement.

    REST framework includes a couple of defaults that may be useful in this context.

    CurrentUserDefault

    A default class that can be used to represent the current user. In order to use this, the 'request' must have been provided as part of the context dictionary when instantiating the serializer.

    diff --git a/api-guide/versioning/index.html b/api-guide/versioning/index.html index 9eb914d391..c16755c71f 100644 --- a/api-guide/versioning/index.html +++ b/api-guide/versioning/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/views/index.html b/api-guide/views/index.html index 018dff7262..bf76846556 100644 --- a/api-guide/views/index.html +++ b/api-guide/views/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/api-guide/viewsets/index.html b/api-guide/viewsets/index.html index e7cc876b24..cf0b530159 100644 --- a/api-guide/viewsets/index.html +++ b/api-guide/viewsets/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • @@ -729,7 +733,7 @@

    Example

    To create a base viewset class that provides create, list and retrieve operations, inherit from GenericViewSet, and mixin the required actions:

    -
    from rest_framework import mixins
    +
    from rest_framework import mixins, viewsets
     
     class CreateListRetrieveViewSet(mixins.CreateModelMixin,
                                     mixins.ListModelMixin,
    diff --git a/community/3.0-announcement/index.html b/community/3.0-announcement/index.html
    index a789f487ec..855017a170 100644
    --- a/community/3.0-announcement/index.html
    +++ b/community/3.0-announcement/index.html
    @@ -289,6 +289,10 @@
                         Release Notes
                       
                       
    +                  
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.1-announcement/index.html b/community/3.1-announcement/index.html index 701a752c71..e9e8f15b82 100644 --- a/community/3.1-announcement/index.html +++ b/community/3.1-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.10-announcement/index.html b/community/3.10-announcement/index.html index 4641cf0f75..643ee4e261 100644 --- a/community/3.10-announcement/index.html +++ b/community/3.10-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.11-announcement/index.html b/community/3.11-announcement/index.html index 148fbdd653..f2757c6ae5 100644 --- a/community/3.11-announcement/index.html +++ b/community/3.11-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • @@ -499,7 +503,7 @@

    Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.13-announcement/index.html b/community/3.13-announcement/index.html index a9b5bacb04..eb7aed93cc 100644 --- a/community/3.13-announcement/index.html +++ b/community/3.13-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.14-announcement/index.html b/community/3.14-announcement/index.html index 7a55994614..9726740c59 100644 --- a/community/3.14-announcement/index.html +++ b/community/3.14-announcement/index.html @@ -57,7 +57,7 @@ - Search @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • @@ -418,7 +422,7 @@

    Documentation search

  • - raise_exceptions argument for is_valid is now keyword-only. + raise_exception argument for is_valid is now keyword-only.
  • @@ -483,9 +487,9 @@

    Django 4
  • Python 3.6+
  • Django 4.1, 4.0, 3.2, 3.1, 3.0
  • -

    raise_exceptions argument for is_valid is now keyword-only.

    +

    raise_exception argument for is_valid is now keyword-only.

    Calling serializer_instance.is_valid(True) is no longer acceptable syntax. -If you'd like to use the raise_exceptions argument, you must use it as a +If you'd like to use the raise_exception argument, you must use it as a keyword argument.

    See Pull Request #7952 for more details.

    ManyRelatedField supports returning the default when the source attribute doesn't exist.

    diff --git a/community/3.15-announcement/index.html b/community/3.15-announcement/index.html new file mode 100644 index 0000000000..b84e062c68 --- /dev/null +++ b/community/3.15-announcement/index.html @@ -0,0 +1,557 @@ + + + + + + + 3.15 Announcement - Django REST framework + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + + + +
    + + +
    + + + + + +

    Django REST framework 3.15

    +

    At the Internet, on March 15th, 2024, with 176 commits by 138 authors, we are happy to announce the release of Django REST framework 3.15.

    +

    Django 5.0 and Python 3.12 support

    +

    The latest release now fully supports Django 5.0 and Python 3.12.

    +

    The current minimum versions of Django still is 3.0 and Python 3.6.

    +

    Primary Support of UniqueConstraint

    +

    ModelSerializer generates validators for UniqueConstraint (both UniqueValidator and UniqueTogetherValidator)

    +

    ValidationErrors improvements

    +

    The ValidationError has been aligned with Django's, currently supporting the same style (signature) and nesting.

    +

    SimpleRouter non-regex matching support

    +

    By default the URLs created by SimpleRouter use regular expressions. This behavior can be modified by setting the use_regex_path argument to False when instantiating the router.

    +

    ZoneInfo as the primary source of timezone data

    +

    Dependency on pytz has been removed and deprecation warnings have been added, Django will provide ZoneInfo instances as long as USE_DEPRECATED_PYTZ is not enabled. More info on the migration can be found in this guide.

    + +

    Searches now may contain quoted phrases with spaces, each phrase is considered as a single search term, and it will raise a validation error if any null-character is provided in search. See the Filtering API guide for more information.

    +

    Default values propagation

    +

    Model fields' default values are now propagated to serializer fields, for more information see the Serializer fields API guide.

    +

    Other fixes and improvements

    +

    There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behaviour.

    +

    See the release notes page for a complete listing.

    + + +
    +
    +
    +
    +
    +
    + +
    +

    Documentation built with MkDocs. +

    +
    + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/community/3.2-announcement/index.html b/community/3.2-announcement/index.html index 20857edcb3..8900813393 100644 --- a/community/3.2-announcement/index.html +++ b/community/3.2-announcement/index.html @@ -289,6 +289,10 @@ Release Notes
  • +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.3-announcement/index.html b/community/3.3-announcement/index.html index 175ced8e82..f8869015be 100644 --- a/community/3.3-announcement/index.html +++ b/community/3.3-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.4-announcement/index.html b/community/3.4-announcement/index.html index 6f625bcd04..41ea183ea8 100644 --- a/community/3.4-announcement/index.html +++ b/community/3.4-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.5-announcement/index.html b/community/3.5-announcement/index.html index e43de8cae5..92d4229336 100644 --- a/community/3.5-announcement/index.html +++ b/community/3.5-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • @@ -523,14 +527,10 @@

    Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.7-announcement/index.html b/community/3.7-announcement/index.html index bf0ec1076b..6c8fba6b33 100644 --- a/community/3.7-announcement/index.html +++ b/community/3.7-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.8-announcement/index.html b/community/3.8-announcement/index.html index 013b60f434..83407f4a53 100644 --- a/community/3.8-announcement/index.html +++ b/community/3.8-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/3.9-announcement/index.html b/community/3.9-announcement/index.html index 933b08e60c..d7491029c1 100644 --- a/community/3.9-announcement/index.html +++ b/community/3.9-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/contributing/index.html b/community/contributing/index.html index 8d8b7e4794..0784f81c27 100644 --- a/community/contributing/index.html +++ b/community/contributing/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/funding/index.html b/community/funding/index.html index 6a7b2df162..d560f31ed3 100644 --- a/community/funding/index.html +++ b/community/funding/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/jobs/index.html b/community/jobs/index.html index b0aca83cf6..d262c320ac 100644 --- a/community/jobs/index.html +++ b/community/jobs/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/kickstarter-announcement/index.html b/community/kickstarter-announcement/index.html index 04f3c423ba..613349d388 100644 --- a/community/kickstarter-announcement/index.html +++ b/community/kickstarter-announcement/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/mozilla-grant/index.html b/community/mozilla-grant/index.html index 797098944a..02f824ac1b 100644 --- a/community/mozilla-grant/index.html +++ b/community/mozilla-grant/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/project-management/index.html b/community/project-management/index.html index fd802f24d7..0380e05c3d 100644 --- a/community/project-management/index.html +++ b/community/project-management/index.html @@ -289,6 +289,10 @@ Release Notes +
  • + 3.15 Announcement +
  • +
  • 3.14 Announcement
  • diff --git a/community/release-notes/index.html b/community/release-notes/index.html index b2aba3c247..3f95891b68 100644 --- a/community/release-notes/index.html +++ b/community/release-notes/index.html @@ -54,7 +54,7 @@

    Because we're using viewsets instead of views, we can automatically generate the URL conf for our API, by simply registering the viewsets with a router class.

    Again, if we need more control over the API URLs we can simply drop down to using regular class-based views, and writing the URL conf explicitly.