我有一个Event表。我有两种不同类型的与会者,员工和学生。我想要做的是让参加者在一张特殊的表格中。将django数据移动/迁移到新表中
的事件表保存:
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
name = models.CharField(max_length=200)
location = models.CharField(max_length=200)
start_date = models.DateTimeField(auto_now=False, auto_now_add=False)
about = models.TextField(null=True, blank=True)
student_attendees = models.ManyToManyField(StudentProfile, null=True, blank=True)
staff_attendees = models.ManyToManyField(StaffProfile, null=True, blank=True)
的与会者表将有:
event = models.ForeignKey(Event)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
profile = generic.GenericForeignKey('content_type', 'object_id')
created = models.DateTimeField(auto_now_add=True)
我怎么会去转移或事件的学生&人员与会者的数据迁移到它的自己的参加者表。 (我没有使用South,并且此时想避免使用它。)。感谢您的帮助和建议。
南由做正是这一点。你为什么想要避免它? – Rod