ruff
2fa2ecbb - [ty] Django: synthesize `get_<field>_display()` methods (#29651)

Commit
27 days ago
[ty] Django: synthesize `get_<field>_display()` methods (#29651) ## Summary This PR adds support for the `get_<field>_display()` methods that Django generates for model fields with `choices`. Example: ```py from django.db import models class Article(models.Model): status = models.CharField( max_length=1, choices=[("D", "Draft"), ("P", "Published")], ) article = Article(status="P") reveal_type(article.status) # str reveal_type(article.get_status_display()) # str ("Published" at runtime) ``` Towards https://github.com/astral-sh/ty/issues/1018. ## Test Plan New Markdown test.
Author
Parents
Loading