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

Error in W8105 Check - Field Name Confused as a Field Attribute #495

Closed
antoniospneto opened this issue Aug 19, 2024 · 1 comment
Closed
Labels

Comments

@antoniospneto
Copy link
Sponsor Contributor

In the [W8105] attribute-deprecated verification, there's an error where the field name is mistakenly identified as a deprecated field attribute.

For example, in the following code:

class ExampleModel(models.Model):
    _name = "example.model"

    length = fields.Float()

The pre-commit check raises the following warning:

[W8105(attribute-deprecated), ExampleModel] attribute "length" deprecated

@pedrobaeza
Copy link
Member

You mustn't use length as a field name, or there will be problems in JS due to the reserved word in that language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants