mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
Ignore external psycopg2 types
This commit is contained in:
@@ -2,7 +2,7 @@ from typing import Any
|
|||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
|
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange # type: ignore
|
||||||
|
|
||||||
class RangeField(models.Field):
|
class RangeField(models.Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ reveal_type(user.text) # E: Revealed type is 'builtins.str'
|
|||||||
[CASE test_model_field_classes_from_exciting_locations]
|
[CASE test_model_field_classes_from_exciting_locations]
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.postgres import fields as pg_fields
|
from django.contrib.postgres import fields as pg_fields
|
||||||
from psycopg2.extras import DateTimeTZRange
|
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
class Booking(models.Model):
|
class Booking(models.Model):
|
||||||
@@ -50,7 +49,7 @@ class Booking(models.Model):
|
|||||||
|
|
||||||
booking = Booking()
|
booking = Booking()
|
||||||
reveal_type(booking.id) # E: Revealed type is 'builtins.int'
|
reveal_type(booking.id) # E: Revealed type is 'builtins.int'
|
||||||
reveal_type(booking.time_range) # E: Revealed type is 'DateTimeTZRange'
|
reveal_type(booking.time_range) # E: Revealed type is 'Any'
|
||||||
reveal_type(booking.some_decimal) # E: Revealed type is 'Decimal'
|
reveal_type(booking.some_decimal) # E: Revealed type is 'Decimal'
|
||||||
|
|
||||||
[CASE test_add_id_field_if_no_primary_key_defined]
|
[CASE test_add_id_field_if_no_primary_key_defined]
|
||||||
|
|||||||
Reference in New Issue
Block a user