■ Character string Char
title = models.CharField(max_length=200)
■ String Text
body = models.TextField()
■ DateTime & initial value setting
pub_date = models.DateTimeField('date published',default=datetime.datetime.now() )
■ Int & list selection
CategoryChoices = (
(1, 'DESIGN'),
(2, 'TECH'),
(3, 'ENTERTAINMENT'),
(4, 'SOCIAL'),
(5, 'BUSINESS'),
(6, 'TRAVEL'),
)
category = models.IntegerField(choices=CategoryChoices)
Recommended Posts