Skip to content

Commit 68f9c09

Browse files
committed
Better default value
1 parent 690c432 commit 68f9c09

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

opendrift_leeway_webgui/api/v1/serializers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ class Meta:
3838
#: Exclude user field because the username is shown instead
3939
exclude = ["user"]
4040

41+
#: Set example values for drf-spectacular Swagger documentation
42+
extra_kwargs = {
43+
"duration": {"default": 12, "help_text": "Length of simulation in hours."},
44+
"radius": {
45+
"default": 1000,
46+
"help_text": "Radius in meters for distributing particles around start coordinates.",
47+
},
48+
}
49+
4150
#: Define fields which are shown when retrieving simulations,
4251
#: but cannot be set when creating new ones
4352
read_only_fields = [

0 commit comments

Comments
 (0)