Skip to content

the ArrayField error :Abstract models cannot be instantiated  #698

Description

@weijchun

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions