Summary
When a Django model class is marked as abstract the lack of a __str__ method is not flagged. This is correct behaviour.
from django.db import models
class Foo(models.Model)
class Meta:
abstract = True
When a type annotation is added to the meta class, the identification of the model being abstract is lost, so the DJ008 diagnostic incorrectly occurs.
from typing import ClassVar
from django.db import models
from django_stubs_ext.db.models import TypedModelMeta
class Foo(models.Model):
class Meta(TypedModelMeta):
abstract: ClassVar[bool] = True
Version
0.12.2