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

Setting __all__ in fields raises a FieldError #313

Closed
czpython opened this issue Sep 30, 2016 · 4 comments
Closed

Setting __all__ in fields raises a FieldError #313

czpython opened this issue Sep 30, 2016 · 4 comments
Milestone

Comments

@czpython
Copy link
Contributor

Django allows forms to define fields = '__all__' to avoid listing all fields in the model, unfortunately this causes the following error:

django.core.exceptions.FieldError: Unknown field(s) (a, l, _) specified for HvadModel
@urtzai
Copy link

urtzai commented Sep 30, 2016

+1

@spectras
Copy link
Collaborator

Definitely. Looks not too hard to add and worth the trouble for ensuring APIs match.
No ETA though, I am in the middle of Turkey posting from a cybercafe right now.

@czpython
Copy link
Contributor Author

czpython commented Oct 1, 2016

Take your time my friend, enjoy Turkey :)

@spectras spectras added this to the v1.7.0 milestone Nov 15, 2016
@spectras
Copy link
Collaborator

spectras commented Nov 15, 2016

Fixed on master.
As a sidenote, not setting fields at all, or setting fields = None used to have exactly the same result. The __all__ thing is a recent addition to Django. And what Django does with it is pretty straightforward: if meta.fields == '__all__': meta.fields = None.

The new whistle will be supported from 1.7.0.

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

No branches or pull requests

3 participants