📜  django __str__ self multiple - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:36.490000             🧑  作者: Mango

代码示例1
class MyclubUser(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)
    email = models.EmailField('User Email')

    def __str__(self):
        return self.first_name + " " + self.last_name


class Subscriber(MyclubUser):
    date_joined = models.DateTimeField()