gpt4 book ai didi

plone - 获取 tal :repeat in another tal:repeat function 的索引

转载 作者:行者123 更新时间:2023-12-04 04:58:48 25 4
gpt4 key购买 nike

如您所见,我有 3 个列表:Procedur_Headers , DiagnosesList_Procedur .Procedur_headers给出我的表格的标题,Diagnoses给出一个过程的特定 id 和List_Procedur是包含我需要的所有数据的列表(查询)列表。
现在我想要做的是将诊断页面的索引放在

tal:repeat="list_procedur List_Procedur[index]"

我可以在我的表中获取我的数据。
我已经可以得到索引:
tal:content="python:repeat['diagnoses'].index"

但我不能在索引的地方这样做。
有没有人有这样的解决方案?
<table id="tableIngrepen" class="table">
<thead class="header">
<tr>
<th>Code Diagnose vast</th>
<th tal:repeat="procedur_headers Procedur_Headers" tal:content="procedur_headers" > </th>
</tr>
</thead>
<tr tal:repeat="diagnoses Diagnoses">
<td tal:content="python:repeat['diagnoses'].index"></td>
<td ><input type='text' id="dz_code" class="input-mini" value="${diagnoses.code_diagnose}" onchange="voegrijtoe_Ingrepen(this.value,this);logging(this,'Code','2')" placeholder="Code"></input></td> <!-- onfocus="rijencolom($(this).parent().children().index($(this)),$(this).parent().parent().children().index($(this).parent()))" -->
<td colspan="6">
<table id="tableIngrepen" class="table table-hover" style="border-style:none">
<thead class="header">
<tr>
<th tal:repeat="procedur_headers Procedur_Headers" tal:content="procedur_headers" > </th> <!-- style="display:none"-->
</tr>
</thead>
<tr tal:repeat="list_procedur List_Procedur[index]">
<td style="max-width: 60px; word-wrap: break-word" >Uitleg over de Code van deze diagnose in maximaal 200 karakters</td>
<td ><input type='text' id="dz_Datum" class="input-small2" value="${list_procedur.code_diagnose}" onchange="logging(this,'Datum','2');datumvalidate(this)" placeholder="yyyy-mm-dd"></input></td>
<td><input type='text' id="dz_dir" class="input-mini1" onchange="logging(this,'Dir','2')" ></input></td>
<td><input type='text' id="dz_aan" class="input-mini1" onchange="logging(this,'Aan','2')" ></input></td>
<td><input type='text' id="dz_uit" class="input-mini1" onchange="logging(this,'Dz','2')" ></input></td>
</tr>
<tr>
<td style="max-width: 60px; word-wrap: break-word" >Uitleg over de Code van deze diagnose in maximaal 200 karakters</td>
<td ><input type='text' id="dz_Datum" class="input-small2" onchange="logging(this,'Datum','2');datumvalidate(this)" placeholder="yyyy-mm-dd"></input></td>
<td><input type='text' id="dz_dir" class="input-mini1" onchange="logging(this,'Dir','2')" ></input></td>
<td><input type='text' id="dz_aan" class="input-mini1" onchange="logging(this,'Aan','2')" ></input></td>
<td><input type='text' id="dz_uit" class="input-mini1" onchange="logging(this,'Dz','2')" ></input></td>
</tr>
</table>
</td>
</tr>
</table>

最佳答案

解决办法是:

<tr tal:repeat="diagnoses Diagnoses"> <div tal:omit-tag="" tal:define="myindex python:repeat['diagnoses'].index"> ..use the myindex.. </div> </tr> 

关于plone - 获取 tal :repeat in another tal:repeat function 的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16400842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com