models.py
from django.db import models from django.contrib.postgres.fields import ArrayFeild class TestInfoUser(models.Model): modify = ArrayField( models.CharField( max_length=128, ), size=20, null=True, blank=True, verbose_name='用户信息' )
shell 脚本
>>> TestInfoUser.objects.create(modify=[('name', '[email protected]'),('lanlan', '[email protected]')]) <TestInfoUser: TestInfoUser object (2)> >>> TestInfoUser.objects.create(modify=[('name', '[email protected]'),('lanlan', '[email protected]'), ('honghong', '[email protected]'), ('kkkk', '77777777777')]) <TestInfoUser: TestInfoUser object (3)> >>> TestInfoUser.objects.create(modify=[('name', '[email protected]'),('lanlan', '[email protected]'), ('honghong', '[email protected]'), ('kkkk', '77777777777', 'ddddd','ddddddddddd')]) <TestInfoUser: TestInfoUser object (4)> >>>