Skip to content

Commit

Permalink
AliasStrategy (docs) 🍩
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibyx committed Aug 15, 2024
1 parent 9294463 commit c1b7216
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ You can override settings population strategies by creating your own population
from django.forms import fields

from django_api_forms import BooleanField, Form
from django_api_forms.population_strategies import AliasStrategy


class BandForm(Form):
Expand All @@ -254,7 +255,8 @@ class BandForm(Form):
}

field_strategy = {
'formed': 'app.population_strategies.ExampleStrategy2'
'formed': 'app.population_strategies.ExampleStrategy2',
'has_award': AliasStrategy(property_name='awarded')
}

name = fields.CharField(max_length=100)
Expand Down

0 comments on commit c1b7216

Please sign in to comment.