我有类似的东西:
{% for mother in mothers_list %}
{% for father in fathers_list %}
{% Child.objects.get(mother=mother, father=father) as child %}
child.name
不幸的是,我不能使用模板中的参数调用函数,所以这一行
{% Child.objects.get(mother=mother, father=father) as child %}
不会工作。关于如何每次获取 Child 对象的任何想法?