mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db import models
|
||||
|
||||
from .fields import (
|
||||
ArrayField, BigIntegerRangeField, CICharField, CIEmailField, CITextField,
|
||||
DateRangeField, DateTimeRangeField, DecimalRangeField, EnumField,
|
||||
HStoreField, IntegerRangeField, JSONField, SearchVectorField,
|
||||
HStoreField, IntegerRangeField, SearchVectorField,
|
||||
)
|
||||
|
||||
|
||||
@@ -68,7 +67,7 @@ class OtherTypesArrayModel(PostgreSQLModel):
|
||||
uuids = ArrayField(models.UUIDField(), default=list)
|
||||
decimals = ArrayField(models.DecimalField(max_digits=5, decimal_places=2), default=list)
|
||||
tags = ArrayField(TagField(), blank=True, null=True)
|
||||
json = ArrayField(JSONField(default=dict), default=list)
|
||||
json = ArrayField(models.JSONField(default=dict), default=list)
|
||||
int_ranges = ArrayField(IntegerRangeField(), blank=True, null=True)
|
||||
bigint_ranges = ArrayField(BigIntegerRangeField(), blank=True, null=True)
|
||||
|
||||
@@ -150,11 +149,6 @@ class RangeLookupsModel(PostgreSQLModel):
|
||||
decimal_field = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
|
||||
|
||||
|
||||
class JSONModel(PostgreSQLModel):
|
||||
field = JSONField(blank=True, null=True)
|
||||
field_custom = JSONField(blank=True, null=True, encoder=DjangoJSONEncoder)
|
||||
|
||||
|
||||
class ArrayFieldSubclass(ArrayField):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(models.IntegerField())
|
||||
|
||||
Reference in New Issue
Block a user