-
-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
The input types OneToManyInput and ManyToOneInput in Strawberry-Django appear to use terminology that is reversed relative to Django’s relationship definitions. This can cause confusion for developers familiar with Django’s ORM semantics.
According to the Django documentation:
To define a many-to-one relationship, use ForeignKey.
However, in strawberry_django/fields/types.py the following mapping is defined:
input_field_type_map = {
...
related.ForeignKey: OneToManyInput,
reverse_related.ManyToOneRel: ManyToOneInput,
...
}The naming appears to be reversed. If you agree, I’d be happy to open a PR to fix it. It looks like we would only need to swap the class names.
Metadata
Metadata
Assignees
Labels
No labels