File tree 1 file changed +16
-0
lines changed 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,22 @@ reveal_type(user.name) # E: Revealed type is 'builtins.str'
37
37
reveal_type(user.slug) # E: Revealed type is 'builtins.str'
38
38
reveal_type(user.text) # E: Revealed type is 'builtins.str'
39
39
40
+ [CASE test_model_field_classes_from_exciting_locations]
41
+ from django.db import models
42
+ from django.contrib.postgres import fields as pg_fields
43
+ from psycopg2.extras import DateTimeTZRange
44
+ from decimal import Decimal
45
+
46
+ class Booking(models.Model):
47
+ id = models.AutoField(primary_key=True)
48
+ time_range = pg_fields.DateTimeRangeField(null=False)
49
+ some_decimal = models.DecimalField(max_digits=10, decimal_places=5)
50
+
51
+ booking = Booking()
52
+ reveal_type(user.id) # E: Revealed type is 'builtins.int'
53
+ reveal_type(booking.time_range) # E: Revealed type is 'DateTimeTZRange'
54
+ reveal_type(booking.some_decimal) # E: Revealed type is 'Decimal'
55
+
40
56
[CASE test_add_id_field_if_no_primary_key_defined]
41
57
from django.db import models
42
58
You can’t perform that action at this time.
0 commit comments