1
试图使用ManyToManyField复制Django模型。Django使用ManyToManyField复制模型
模型是
class Book(models.Model):
cats = models.ManyToManyField(Category)
的观点:
for book in books:
book.name = "New Name"
messageinfo = message.save()
msg = Book(title=book.title, subject=book.subject)
msg.save()
排序作品到这里的,让书的副本
下得到一个错误
for cat in book.cats:
info = Category.objects.get(id=cat.id)
msg.cats.add(info)
Erro ř它产生
TypeError at/
'ManyRelatedManager' object is not iterable