我有《示范公约》:
class TreeComment(models.Model):
parent = models.ForeignKey( self , null=True, blank=True, verbose_name= Parent )
title = models.TextField(_( Title ), blank=True)
我想打上<代码>TreeComment.objects.all(),并将结果值列入一些清单:
for e in TreeComment.objects.all():
some_list += e
能否将所有价值观列入清单,包括父母的价值?
Not whole parent object but id only (to prevent unnecessary DB calls and joins). After that I will process it without DB calls inside the bussiness logic.