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

E0307 false positives when returning model fields #403

Open
sevdog opened this issue Sep 1, 2023 · 0 comments
Open

E0307 false positives when returning model fields #403

sevdog opened this issue Sep 1, 2023 · 0 comments

Comments

@sevdog
Copy link

sevdog commented Sep 1, 2023

When using pylint django if in model __str__ method a field is returned pylint cannot recognize that this field should be a string.

from django.db import models

class Model(models.Model):
    field = models.CharField(max_length=10)

    def __str__(self):  # E0307
        return self.field

It would be nice if this plugin was able to detect if a field which inherits from CharField or TextField is used and suppress this error.

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

1 participant