django arrayfield tutorial code example
Example 1: arrayfield django example
from django.db import models, FloatField
from django.contrib.postgres.fields import ArrayField
class Book(models.Model):
ratings = ArrayField(FloatField())
Example 2: arrayfield django example
from django.contrib.postgres.fields import ArrayField
from django.db import models
class ChessBoard(models.Model):
board = ArrayField(
ArrayField(
models.CharField(max_length=10, blank=True),
size=8,
),
size=8,
)