Django : select_related with ManyToManyField

前端 未结 2 1774
一生所求
一生所求 2021-02-12 06:33

I have :

class Award(models.Model) :
    name = models.CharField(max_length=100, db_index=True)

class Alias(models.Model) :
    awards = models.ManyToManyField(         


        
2条回答
  •  梦毁少年i
    2021-02-12 07:00

    If you're not on Django 1.4, there's also the django-batch-select library, which works basically the same way as prefetch_related.

提交回复
热议问题