嵌套 ArrayFields

你可以通过传递另一个 ArrayField 来嵌套 ArrayFields,因为它是 base_field

from django.db import models, IntegerField
from django.contrib.postgres.fields import ArrayField

class SudokuBoard(models.Model):
    numbers = ArrayField(
        ArrayField(
            models.IntegerField(),
            size=9,
        ),
        size=9,
    )