我想在 Django 中创建两个模型
class BlogPost(models.Model):
body = models.TextField()
delete = models.BooleanField(default=True)
def save(self, *args, **args):
if self.delete():
# move object to Post Archive
class BlogPostArchive(BlogPost):
date_deleted = models.DateTimeField(auto_now_add=True)
我将如何定义将需要删除的 BlogPost 对象迁移到存档中的方法?