📜  custom-field-list_display - Python 代码示例

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

代码示例1
from django.contrib.auth.models import User
from django.db import models

class Customer(models.Model):
    ....
    @property
    def full_name(self):
        return "%s %s"%(self.user.first_name, self.user.last_name)

    def __str__(self):
        return self.full_name
Copy