djongo icon indicating copy to clipboard operation
djongo copied to clipboard

the ArrayField error :Abstract models cannot be instantiated

Open weijchun opened this issue 1 year ago • 0 comments

class Option(models.Model): """ """ lr = models.CharField()

class Meta:
    abstract = True

def __str__(self):
    return self.lr

class StudentsModel(models.Model): """ """ name = models.CharField('name',default='',max_length=10) lrs = models.ArrayField(model_container=Option,blank=True)

class Meta:
    db_table = "cblue_students"

def __str__(self):
    return self.name

required: python3.9.19 django4.1.13 djongo1.3.6 pymongo3.12.1 mongodb6.0.16

weijchun avatar Jul 23 '24 03:07 weijchun