Skip to content

v0.22.1 - Model rules read translated verbose_name; auth fields counted

Choose a tag to compare

@github-actions github-actions released this 17 Nov 05:12
· 37 commits to main since this release
cacb63f

Model rules read translated verbose_name; auth fields counted.

Fixed

  • Count the fields Django's auth bases give a custom user model
    (#267).
    A model built on AbstractBaseUser, PermissionsMixin or AbstractUser
    now inherits their fields (password, last_login, is_superuser,
    groups, user_permissions, and the profile fields of AbstractUser) in
    both parsers, so drift no longer reports them as migrated but no longer
    declared. A workspace class with the same name still wins, a field the
    model sets to None (username = None) stays removed, and an abstract
    parent's own field now overrides the same field from its ancestors.

  • VS Code rules DOL011 / DOL014 / DOL015 read past nested calls.
    CharField(max_length=100, verbose_name=_("Name"), null=True) was never
    matched: the rules scanned the call with ([^()]*), which stops at the
    paren inside _("Name"). i18n-wrapped fields escaped the null=True,
    missing-max_length and TextField(max_length=) checks. All three now use
    the same readCallArgs helper DOL013 already used.

  • Parser: ignore Django field examples inside model docstrings. Both the
    CLI and VS Code now keep those examples out of the model's field list.

  • suggest-indexes: only propose indexes on local columns
    (#252).
    Many-to-many and reverse relation lookups still appear in usage counts,
    but no longer produce invalid Meta.indexes suggestions. Django field imports
    that use an alias keep their original field type in both parsers.

  • Recognize directly imported Django field types (#250).
    The CLI and VS Code parsers now recognize GeneratedField and PostgreSQL
    fields such as ArrayField, HStoreField, range fields, and
    SearchVectorField. Schema drift checks can now match those declarations
    to their migrations.