多字段联合约束

class ContestMatchProject(models.Model):
    """
    比赛分配的项目
    """
    match = models.ForeignKey(ContestMatch)
    project = models.ForeignKey(ContestEnrollProject)
    createTime = models.DateTimeField(db_column='create_time', default=timezone.now)

    class Meta:
        db_table = 'c4_contest_match_project_rel'
        ordering = ('createTime', )
        unique_together = ('match', 'project',)

[ 编辑 | 历史 ]
最近由“jilili”在“2017-05-13 01:17:58”修改