In Django's document Django Document
It has following code.
from django.contrib import admin
class AuthorAdmin(admin.ModelAdmin):
fields = ('name', 'title', 'view_birth_date')
def view_birth_date(self, obj ):
return obj.birth_date
view_birth_date.empty_value_display = '???'
I don't understand in the custom method view_birth_date(self, obj ) where this obj parameter came from?
Note in the last line, it called this function,
view_birth_date.empty_value_display = '???'
but did not pass any parameter for obj. I don't understand where how obj got a value.
Thanks!