Django model create reported an error

class Article (models.Model):

id=models.BigAutoField(primary_key=True)
title=models.CharField(max_length=32)
publishtime=models.DateTimeField(auto_now_add=True)
catalogs=models.ForeignKey(to="Catalog")
tags=models.ManyToManyField("Tag")
-sharp content=models.OneToOneField(to="ArticleContent")
content=models.TextField()
Test program

catalogs=models.Catalog.objects.all ()
tags=models.Tag.objects.all ()
c=random.choice (catalogs)
t=random.choice (tags)
models.Article.objects.create (title="article"+str (i), catalogs=c,tags=t,content=str (i))

error
ValueError: "< Article: article4 >" needs to have a value for field "id" before this many-to-many relationship can be used.

indicates that
id is self-increasing in the database, but the display definition is used when setting up the model. When bigauto, causes data to be added, it is also displayed that the specified id, does not want to be specified, but wants to add itself through the database.

Mar.01,2021

remove the line id


there is a problem with the manytomanyfield operation

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9d82b-4773a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9d82b-4773a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?