-
Notifications
You must be signed in to change notification settings - Fork 117
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
Instance of 'CharField' has no 'upper' member warning (no-member) #7
Comments
This is because at run time, model fields are treated like the underlying python type. So a I'd be happy to work on a solution to this. But I'm not sure what the best approach is. I attempted to solve it here: jproffitt@42548e4. But maybe there's a better way? |
as far as the |
@jproffitt, actually I think your solution is very very elegant! That's what the Django metaprogramming does anyway, at runtime, the attributes on the model class are @alisaifee You're right a more general solution would be nice, but I don't know if pylint's inference is powerful enough to figure out the value of
|
I can't think of any way to do a more general solution. I don't think pylint can do that... if it can, let me know, because that would be awesome. I will create a PR with my solution. Is there any other fields I should add besides I don't have any ideas for |
…go fields based on the idea of @jproffitt - they all now extend both the Django field (for constructor use and direct manipulation and usage) as well as a type which accurately reflects what they are transformed into by the model meta-programming
…form fields should now have the behaviour both of the parent Django Field type as well as the more fundamental type they represent
@jproffitt I took your suggestion and changed it a little, so now all Field classes extend the Django Field and the type they represent, which removes almost all of the errors 👍 This will be available in the 0.5 release (coming soon) |
What about |
|
See #21 |
When I access a CharField in a model and call the upper() method, pylint complains. However, this is valid at runtime.
The text was updated successfully, but these errors were encountered: