I am learning Django following the book "Django for beginners", there is a strange problem. The code snippet below actually works, but Pylint keeps showing me an error, and I know the error happens. But the author did nothing about it. Does anyone know why, please? The code snippet is from my app folder's models.py.
from django.db import models
# Create your models here.
class Post(models.Model):
text = models.TextField()
def __str__(self):
return self.text[:50]
The pylint error message in my vscode editor is - Value 'self.text' is unsubscriptable
My environment: Win 10, Python 3.6, Django 3.0.1