DEV Community

Cover image for Django 5.0 is here
Bogusdeck
Bogusdeck

Posted on β€’ Edited on

Django 5.0 is here

Django 5.0 is released πŸŽ‰πŸŽ‰πŸŽ‰

Lot of exiting changes to DjangoORM and more..

Let's take a brief look at what's new.

  • Generated fields

The new GeneratedField enables the creation of database-generated fields, where values are automatically computed by the database itself based on other fields (and indexable too). For example, if you have first_name and last_name fields, you can use a GeneratedField to create a full_name property that is a combination of the two, allowing the database to handle the generation process.

  • Database-computed default values

This was the last significant obstacle to fully representing the structure of Django models in the database schema. In Django versions prior to 5.0, the only option for setting a default value for a field was through Field.default, and it was calculated on the Python side, not in the database. The new Field.db_default option addresses this limitation by allowing the creation of default values directly in the database schema, providing a valuable improvement for consistency

  • Form field group rendering

The new concept of form field group rendering makes field rendering simpler and more reusable. Now you can use filed.as_field_group to render separate fields without any inconsistencies.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay