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

After update to 0.1.9 "DJ008 Model does not define __str__ method" appears #9242

Closed
sshishov opened this issue Dec 22, 2023 · 2 comments · Fixed by #9338
Closed

After update to 0.1.9 "DJ008 Model does not define __str__ method" appears #9242

sshishov opened this issue Dec 22, 2023 · 2 comments · Fixed by #9338
Assignees
Labels
bug Something isn't working

Comments

@sshishov
Copy link

After release of 0.1.9 the issue with base class inheritance start appearing (same file)

The issue possibly related to this PR: #9151

DJ008 Model does not define `__str__` method

Example:

import typing_extensions
from django.db import models as django_models

class ParentModel(django_models.Model):
    class Meta:
        abstract = True

    @typing_extensions.override
    def __str__(self) -> str:
        return f'{self.id}'

class ChildModel(ParentModel):  # <-- DJ008 Model does not define `__str__` method
    pass

Current ruff version: 0.1.9
Configuration: --strict with some small exclusions

@charliermarsh charliermarsh added the bug Something isn't working label Dec 22, 2023
@charliermarsh
Copy link
Member

Thank you, that's my mistake.

@sshishov
Copy link
Author

No worry @charliermarsh , not a critical issue, just small omission! We have added type: ignore by now, when the issue is fixed, it will be reported as unused ignore 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants