2014-07-26 1 views
1

에서 목록에서 데이터를 인쇄 출력하는 방법 :등과 같이 아래, 나는 목록에 덤프 데이터를 가지고있는 코드에서 web2py

def foo(): 
    list1=[It’s possible Arianne could appear in future seasons, but as Kotaku notes, the official character bio of Trystane describes him as the heir to Dorne, while Ariane’s love interest, Aerys Oakheart, has also not been cast. The exclusion comes as a surprise to fans, not just because Arianne is a major player in the fantasy novels’ numerous plot twists, but also because she was a strong, complex female character in a fictional universe that doesn’t have too many of those.] 
    return list1 

보기 HTML에서 :

{{extend 'layout.html'}} 
<h1>{{=list1}}</h1> 

각 문장을 글 머리 기호로 인쇄하려면 어떻게해야합니까?

답변

0

컨트롤러 :

def foo(): list1=["It's possible Arianne could appear in future seasons, but as Kotaku notes, the official character bio of Trystane describes him as the heir to Dorne, while Ariane’s love interest, Aerys Oakheart, has also not been cast.", "The exclusion comes as a surprise to fans, not just because Arianne is a major player in the fantasy novels’ numerous plot twists, but also because she was a strong, complex female character in a fictional universe that doesn’t have too many of those."] return dict(list1=list1)

보기 :

{{extend 'layout.html'}}

<ul>

{{pass}}

</ul>

뷰리스트를 반복하고 상기 제어기에 의해 전달 각 항목 당 하나의 "리튬"태그를 생성

<li>{{=row}} </li>.