Skip to content

Commit 6fd7446

Browse files
committed
[FIX] getting_started: remove useless lambda
The lambda function here is useless and makes newdooers think they need to use it everytime. `default=fields.Date.add(fields.Date.today(), months=3))` should do the trick, no lambda involved. closes #6632 X-original-commit: 620508f Signed-off-by: Antoine Vandevenne (anv) <[email protected]> Signed-off-by: Claire Bretton (clbr) <[email protected]>
1 parent 0dd8974 commit 6fd7446

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/developer/tutorials/getting_started/06_firstui.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Any field can be given a default value. In the field definition, add the option
232232
float, string) or a function taking a model and returning a value::
233233

234234
name = fields.Char(default="Unknown")
235-
last_seen = fields.Datetime("Last Seen", default=lambda self: fields.Datetime.now())
235+
last_seen = fields.Datetime("Last Seen", default=fields.Datetime.now)
236236

237237
The ``name`` field will have the value 'Unknown' by default while the ``last_seen`` field will be
238238
set as the current time.

0 commit comments

Comments
 (0)