-
-
Notifications
You must be signed in to change notification settings - Fork 537
Open
Description
Describe the bug
A clear and concise description of what the bug is.
Versions (please complete the following information):
- Python version: 3.11
- Django version: 4.2.33
- Django-Ninja version: 1.1.0
- Pydantic version: 2.11.4
Not sure if that intentional, but that doesn't make a lot of sense:
class OrderOut(ModelSchema)
class Meta:
model = Order
fields = [ "user_id"] # user_id is foreignkey on Order model
Serialization fails with error like:
ninja.errors.ConfigError: DjangoField(s) {'user_id'} are not in model <class 'app.models.Order'>
However if I change the field to user instead of user_id it does work. Why is that? I believe user_id should also work.
Metadata
Metadata
Assignees
Labels
No labels