|
49 | 49 | content: | |
50 | 50 | from django.db import models |
51 | 51 | from django.contrib.postgres.fields import ArrayField |
52 | | - from django_stubs_ext.db.models import BaseModelMeta |
| 52 | + from django_stubs_ext.db.models import TypedModelMeta |
53 | 53 | class AbstractModel(models.Model): |
54 | | - class Meta(BaseModelMeta): |
| 54 | + class Meta(TypedModelMeta): |
55 | 55 | abstract = True |
56 | 56 | class MyModel(AbstractModel): |
57 | 57 | field = ArrayField(models.IntegerField(), default=[]) |
58 | 58 | - case: base_model_meta_incompatible_types |
59 | 59 | main: | |
60 | 60 | from django.db import models |
61 | 61 | from django.contrib.postgres.fields import ArrayField |
62 | | - from django_stubs_ext.db.models import BaseModelMeta |
| 62 | + from django_stubs_ext.db.models import TypedModelMeta |
63 | 63 |
|
64 | 64 | class MyModel(models.Model): |
65 | 65 | example = models.CharField(max_length=100) |
66 | | - class Meta(BaseModelMeta): |
67 | | - abstract = 7 # E: Incompatible types in assignment (expression has type "int", base class "BaseModelMeta" defined the type as "bool") |
68 | | - verbose_name = ['test'] # E: Incompatible types in assignment (expression has type "List[str]", base class "BaseModelMeta" defined the type as "Union[str, _StrPromise]") |
69 | | - unique_together = {1: 2} # E: Incompatible types in assignment (expression has type "Dict[int, int]", base class "BaseModelMeta" defined the type as "Union[Sequence[Sequence[str]], Sequence[str]]") |
| 66 | + class Meta(TypedModelMeta): |
| 67 | + abstract = 7 # E: Incompatible types in assignment (expression has type "int", base class "TypedModelMeta" defined the type as "bool") |
| 68 | + verbose_name = ['test'] # E: Incompatible types in assignment (expression has type "List[str]", base class "TypedModelMeta" defined the type as "Union[str, _StrPromise]") |
| 69 | + unique_together = {1: 2} # E: Incompatible types in assignment (expression has type "Dict[int, int]", base class "TypedModelMeta" defined the type as "Union[Sequence[Sequence[str]], Sequence[str]]") |
70 | 70 | unknown_attr = True # can't check this |
0 commit comments