summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/5.0.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt
index 0be2872346..b60f7a6c76 100644
--- a/docs/releases/5.0.txt
+++ b/docs/releases/5.0.txt
@@ -134,7 +134,15 @@ Database generated model field
The new :class:`~django.db.models.GeneratedField` allows creation of database
generated columns. This field can be used on all supported database backends
-to create a field that is always computed from other fields.
+to create a field that is always computed from other fields. For example::
+
+ from django.db import models
+ from django.db.models import F
+
+
+ class Square(models.Model):
+ side = models.IntegerField()
+ area = models.GeneratedField(expression=F("side") * F("side"), db_persist=True)
More options for declaring field choices
----------------------------------------