-
Notifications
You must be signed in to change notification settings - Fork 41
Description
When I use a string Projection and try to filter on a field my view should have, I get this error FieldError: cannot resolve keyword 'x' into field. Choices are: id.
After a quick investigation in the ViewMeta, it seems the fields from my real model are not being copied immediately and are put in a deferred situation because they are strings. The thing is, as they are deferred, the super new is called without them being attributed and that apparently causes django to miss them. I then only get one field on my view in the end, which is id.
As the issue was with the projection being a string, I tried putting projection = MyModel._meta.fields but got an error with reverse name clashes on the foreign keys.
Do you have any solution for this problem ?
I don't want to specify every field on my view especially since they are the same.