class Template(models.Model):
name = models.CharField(max_length=135, blank=True)
pattern = models.ForeignKey(Pattern)
create_time = models.DateTimeField()
creator = models.CharField(max_length=135, blank=True)
我想要 :
Template.objects.extra(where=[str]).order_by('create_time')
并根据外键“模式”来区分结果。这个怎么做?谢啦~