please forgive my ignorance,
but I wonder why views are not written in Python, instead of html ( see
comparison below of te first
part of default\index.html.
The advantage of using Python:
- the user can stick to 1 language
- no redundant information in the closing tags, like <ul> , </ul>
- most editors checks the closing brackets
- normal indentation, no problems with missing "pass"
The disavantages of using Python:
- ???
thanks,
Stef Mientki
# ***************************************************************
extend ( 'layout.html' )
if 'message' in globals () :
H2 ( message )
else:
DISPLAY ( BEAUTIFY ( response._vars ) )
HR ()
H1 ( 'README' )
UL (
LI ( T ( 'You are successfully running web2py' ) ),
LI ( T ( 'This is a copy of the scaffolding application' ) ),
LI ( T ( 'You can modify this application and adapt it to your needs' ) ),
LI ( T ( A ( B ( T ( "click here for the administrative interface")),
_HREF ( URL ( 'admin', 'default', 'index' ) ) ) ) ),
LI ( A ( T ( "click here for online examples"),
_HREF ( URL ( 'examples', 'default', 'index' ) ) ) ),
LI ( HREF ( "http://web2py.com", 'web2py.com' ) ),
LI ( HREF ( "http://web2py.com/book", T ( 'documentation' ) ) ) )
# ***************************************************************
{{extend 'layout.html'}}
{{if 'message' in
globals():}}{{=H2(message)}}{{else:}}{{=BEAUTIFY(response._vars)}}{{pass}}
<hr />
<h1>README</h1>
<ul>
<li>{{=T('You are successfully running web2py')}}</li>
<li>{{=T('This is a copy of the scaffolding application')}}</li>
<li>{{=T('You can modify this application and adapt it to your needs')}}</li>
<li>{{=A(B(T("click here for the administrative interface")),
_href=URL('admin','default','index'))}}</li>
<li>{{=A(T("click here for online examples"),
_href=URL('examples','default','index'))}}</li>
<li><a href="http://web2py.com">web2py.com</a></li>
<li><a href="http://web2py.com/book">{{=T('documentation')}}</a></li>
</ul>