Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection not working with MaterializedView #48

Open
PhilipGarnero opened this issue May 10, 2019 · 2 comments
Open

Projection not working with MaterializedView #48

PhilipGarnero opened this issue May 10, 2019 · 2 comments

Comments

@PhilipGarnero
Copy link

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.

@DanielGnzlzVll
Copy link

Hi @PhilipGarnero ,

I have the same problem and I could not find a solution, did you find any solutions?

@scott-w
Copy link
Contributor

scott-w commented Jun 21, 2020

Hey there, apologies for not replying.

I no longer work for Pebble and, as far as I know, Pebble are no longer maintaining this project. I'd recommend having a look at forks from this project that may be able to better support you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants