DJ001 is not raised for models which doesn't directly inherits from django.db.models.Model. The source of bug is in https://github.com/charliermarsh/ruff/blob/f7515739acc0a7b5c580bf05aac6055181739c65/crates/ruff/src/rules/flake8_django/rules/helpers.rs#L6 It should lookup whole mro for the Model class.
Affected version: 0.0.246
Snippet reproducing bug:
from django.db import models
from django.utils.translation import gettext_lazy as _
from utils.models import BaseModel
class ExampleModel(BaseModel):
name = models.CharField(max_length=255, verbose_name=_('Name'), null=True)
description = models.TextField(verbose_name=_('Description'))
def __str__(self) -> str:
return self.name