We know that Django release it latest new version 3.2 so next question is what is exactly new feature :
Following are the some new Feature are Available in Django 3.2:
Table of Contents
New Features in the Django Framework 3.2
1.New admin Decorators
2.Value Detects type
3.Loud signal Receiver
5.Trun date for time-zone
6.JSON object Building
Some important Features of Django 3.2
(a) It has feature of covering indexes which allow us to store a additional column in an index. When a query only uses field that are present in the index, the database can use an index-only scan meaning the actual table is not accessed at all, this is one of the advantage. This makes queries faster.
(b) It will provide Timezone to TruncDate. Earlier the timezone was set internally according to the current timezone.
(c) It will facilitate building JSON Objects. In Django 3.2, that function that accepts arbitrary key-value pair was added to the ORM.
(d) Loud Signal Receiver.
(e) The new QuerySet.alias() method allows creating reusable aliases for expressions that don’t need to be selected but are used for filtering as a part of complex expressions.
(f) Value () expression now automatically resolves its output_field to the appropriate Field subclass based on the types of it’s provided value for bool, bytes, float, int, str, date etc.
(g) There are navigable link in the admin.
(h) Cached templates are reloaded on Django’s development server.
(i) There is a feature of new admin decorators. In earlier versions, to customize a calculated field in the Django admin you first added a function and then assigned some attributes to it.
Explanation of Each Feature in one by one:
1.New admin Decorators:
Django’s admin accepts callable for list_display and read only_fields. In order to customize these callable (e.g. annotate them with a description) django requires developer to set an attribute on a callable (e.g. ‘short_description’). This is a simple approach and it works.
But it is easy to make a typo or to forget what attribute should be set on a callable because there is no auto completion.
- Value detects type : Value now automatically resolves its output_field to the appropriate Field subclass based on the type of its provided value for bool, bytes, float, int, str, datetime.date, datetime.datetime, datetime.time, datetime.timedelta, decimal.Decimal, and uuid.UUID instances. As a consequence, resolving an output_field for database functions and combined expressions may now crash with mixed types when using Value(). You will need to explicitly set the output_field in such cases.
- Loud signal receiver: To never miss excepections in signal , they introduce loud signal which is no longer necessary.
- Covering index: The main benefit of a covering index is that when a query only uses fields that are present in the index, the database can use an index-only scan, meaning the actual table is not accessed at all. This can make queries faster.
- Trunc date for time-zone : It allows truncating Date in Any specific time-zone.
- JSON object building : Like POSTgreSQL now have handy JSON object builing capacity.
- Wishlist: There are still few things Django needs to improve:
- a. Type hinting
- b. Connection pooling , view and partition in DB
- c.Returning update status etc