Pylance use Django V4 after Upgrading to Django V5

I have a model like this:

class Test(models.Model):
    a = models.TextField(null=True, blank=True)
    b = models.TextField(null=True, blank=True)

    class Meta:
        constraints = [
            models.CheckConstraint(
                condition=models.Q(a__isnull=False) | models.Q(b__isnull=False),
                name="not_both_null",
            ),
        ]

After migrating to Django V5, VS code is reporting: enter image description here

However the check constraint has been updated in Django V5: enter image description here

It feels like Pylance is using "cached" old version somehow.

I have tried following ways:

  • Update Python and Pylance extensions to the latest.
  • Restart VS Code/reload window.
  • Restart Pylance server.
  • Set 'python.analysis.extraPaths' to my venv.
  • Reinstall Pylance.

Any other ways I can try?

Вернуться на верх