Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pipenv run python manage.py spectacular --color --file openapi-schema.yml` to bu
```

# Contributing
See [contribution guide](CONTRIBUTING.md).
See [contribution guide](.github/CONTRIBUTING.md).
# Tests

Tests are located in the `api/tests` directory. These should be run before pushing new changes to the main repository. These tests require that the api is [running](##run) at `http://localhost:8000`.
Expand Down
5 changes: 5 additions & 0 deletions api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class Meta:


class MonsterFilter(CommonFilterSet):
environments = django_filters.CharFilter(
field_name="environments_json", lookup_expr="icontains"
)

class Meta:
model = models.Monster
fields = {
Expand All @@ -91,6 +95,7 @@ class Meta:
"hit_points": ["exact", "range", "gt", "gte", "lt", "lte"],
"armor_class": ["exact", "range", "gt", "gte", "lt", "lte"],
"type": ["iexact", "exact", "in", "icontains"],
"environments_json": ["iexact", "exact", "in", "icontains"],
"size": ["iexact", "exact", "in", "icontains"],
"page_no": ["exact", "range", "gt", "gte", "lt", "lte"],
"document__slug": [
Expand Down