Re format code example

This commit is contained in:
Jonathan Kim 2020-04-25 14:12:40 +01:00
parent 95868465ef
commit 903cebbe0c

View File

@ -124,10 +124,14 @@ create your own ``FilterSet``. You can pass it directly as follows:
# Do case-insensitive lookups on 'name'
name = django_filters.CharFilter(lookup_expr=['iexact'])
# Allow multiple genera to be selected at once
genera = django_filters.MultipleChoiceFilter(field_name='genus',
choices=(('Canis', 'Canis'),
('Panthera', 'Panthera'),
('Seahorse', 'Seahorse')))
genera = django_filters.MultipleChoiceFilter(
field_name='genus',
choices=(
('Canis', 'Canis'),
('Panthera', 'Panthera'),
('Seahorse', 'Seahorse')
)
)
class Meta:
model = Animal