- Make it when building the corresponding model
e.g.1: question_text = models.CharField('question', max_length=200)
e.g.2: pub_date = models.DateTimeField('date published') - Or, you can make it through the admin.py, Django's build-in admin model
short_description
e.g.: was_published_recently.short_description = 'Published recently?' - Or you let Django do the rest of the job using class option 'list_display'
list_display = ('first_name', 'last_name')
Django will set column name as First name and Last name where they are both 'database fields', underscores will be evaluated as spaces
Django makes the first parameter as the field show in admin UI, in this case "Date published" and "Question" will be shown.
The corresponding column will be shown with readable text
沒有留言:
張貼留言