巢狀 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,
    )