user_image
By  亮亮跄跄only    On   2018年12月17日 23:33

from django.db import models # Create your models here. class Person(models.Model): name = models.CharField(max_length=128) def __str__(self): return self.name class Group(models.Model): name = models.CharField(max_length=128) members = models.ManyToManyField(Person,through='Membership') def __str__(self): return self.name class Membership(models.Model): person = models.ForeignKey(Person,on_delete=models.CASCADE) group = models.ForeignKey(Group,on_delete=models.CASCADE) data_join=models.DateField() invite_reason = models.CharField(max_length=200)



登录后方可评论
暂不评论,返回页面!