콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3924 화면

Hello my friends!!

I am trying to call a python function in a mako file.

I have tried but i have got an error.

python:

def get_date(self, context=None): 

obj = {}

res_list=[]

obj['date_from'] = datetime.now().strftime('%Y-%m-%d')

res_list.append(obj)

return res_list

Mako:

%for item in get_date():

<tr style='height:8.5pt'>

<td width=214 style='width:160.5pt;border-left:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;

background:#FCE4D6;padding:0cm 3.5pt 0cm 3.5pt;height:8.5pt'>

<p class=MsoNormal align=right style='margin-bottom:0cm;margin-bottom:.0001pt;

text-align:right;text-indent:8.05pt;line-height:normal'><b><span

style='font-size:8.0pt;font-family:"Arial","sans-serif";color:black'>${item.date_from}</span></b></p>

</td>

</tr>

%endfor

Please, need an answer

Regards

아바타
취소
관련 게시물 답글 화면 활동
1
12월 15
4781
3
11월 15
13195
1
11월 15
6635
2
5월 22
34419
0
3월 19
4357