Guillaume Andreu Sabater
Guillaume Andreu Sabater
and yes, django-oauth-toolkit pointed that bug out for me too ;)
this feels like a django 2.0 addition. Having a PR dropping compat with Django < 1.11 and fixing 2.0 and 2.1 is on my TODO. Will keep you posted. Cheers
see #384 and #385
```python @strawberry.django.filters.filter(models.Submission, lookups=True) class SubmissionFilter: updated_date: strawberry.django.auto ``` ```gql submissions (filters: {updatedDate: {lte: "2020-02-02"}}) { submissionId updatedDate } ``` See https://github.com/strawberry-graphql/strawberry-graphql-django/blob/main/strawberry_django/filters.py
The way I'm implementing it is the following: ```python class RootModel(models.Model): ... class Model(models.Model): root_model = models.ForeignKey(RootModel) ... class ReverseRelationModel(models.Model): root_model = models.ForeignKey(RootModel, related_name="reverse_relation_set") ... ``` ```python @strawberry.django.type(ReverseRelationModel) class ReverseRelationModelType:...
But this feels hard to make generic. Especially if you need special prefetching cases using django's `Prefetch`.
It seems you're not using the latest version, which is compat with Django 4.0.x: See #317