pylint-django
pylint-django copied to clipboard
E0307 false positives when returning model fields
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.