Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

custom-field-list_display

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
Source by www.dothedev.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+1 =