fix redefining field with name id with different than int type

This commit is contained in:
Maxim Kurnikov
2019-02-15 21:54:40 +03:00
parent 63a14f7107
commit c382d6aa2f
3 changed files with 20 additions and 2 deletions

View File

@@ -93,4 +93,14 @@ class Abstract(models.Model):
abstract = True
class User(Abstract):
id = models.AutoField(primary_key=True)
[out]
[CASE standard_it_from_parent_model_could_be_overridden_with_non_integer_field_in_child_model]
from django.db import models
import uuid
class ParentModel(models.Model):
pass
class MyModel(ParentModel):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
reveal_type(MyModel().id) # E: Revealed type is 'uuid.UUID'
[out]