这是模型:
TYPE_CHOICES = (
('x','Some X'),
('y','Some Y'),
('z', 'Some Z'),
)
class MyModel(models.Model):
some_type = models.CharField(max_length=1, choices=TYPE_CHOICES)
desc = models.TextField()
date_added = models.DateFimeField()
我想先获取记录,some_type='x'
然后再获取其他记录(都按date_added
每个“组”排序)