d j a n g o 在 查 找 数 据 的 时 候 根 据 添 加 的 时 间 排 序 django在查找数据的时候根据添加的时间排序 django在查找数据的时候根据添加的时间排序
class Book(models.Model):
name = models.CharField(max_length=20,null=False)
desc = models.CharField(max_length=100,name='description',db_column="description1")
pub_date = models.DateTimeField(auto_now_add=True)
class Meta:
db_table = 'book_model'
ordering = ['pub_date']