我有复杂的对象,其他对象的复合列表。 我将此对象序列化为JSON值以执行创建viewModel。
class refereereport(Model):
competition = models.ForeignKey(competition, on_delete=models.CASCADE)
reportdate = models.CharField(max_length=10)
reporttime = models.CharField(max_length=10)
reviewerreferee = models.ForeignKey(reviewer, on_delete=models.CASCADE)
federationdeletage = models.CharField(max_length=100)
longdescriptions = models.TextField()
isdelete = models.BooleanField()
class competitionreferee(Model):
competitionkey = models.ForeignKey(competition, on_delete=models.CASCADE)
referee = models.ForeignKey(referee, on_delete=models.CASCADE)
type = models.CharField(max_length=30, choices=refereemebers)