flake8-django
flake8-django copied to clipboard
Adding a checker for model styles
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#model-style
Specifically the following part:
The order of model inner classes and standard methods should be as follows (noting that these are not all required):
- All database fields
- Custom manager attributes
class Meta
def __str__()
def save()
def get_absolute_url()
- Any custom methods
I'm interested in writing this checker, but I wanted first to confirm if there would be interest in getting it merged.
Isn't that DJ12?
Found the problem, on the pyproject.toml file it should be "DJ = …", instead of "DJ0 = …", that's why it wasn't running.
It would also be nice if it could detect if you’re inheriting from another class.
On Thu, 9 Mar 2023 at 13:31 Marijke Luttekes @.***> wrote:
Isn't that DJ12 https://github.com/rocioar/flake8-django/wiki/%5BDJ12%5D-Order-of-Model's-inner-classes,-methods,-and-fields-does-not-follow-the-Django-Style-Guide ?
— Reply to this email directly, view it on GitHub https://github.com/rocioar/flake8-django/issues/107#issuecomment-1461961722, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJK2L46K4UWJ5KNCZDFAFLW3HETNANCNFSM6AAAAAAVADWSVY . You are receiving this because you authored the thread.Message ID: @.***>