examples uses cookie based sessions
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.4.2-stable+timestamp.2013.03.11.08.24.51
|
Version 2.4.2-stable+timestamp.2013.03.11.08.49.11
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
session.forget()
|
session.forget()
|
||||||
|
|
||||||
response.menu = [['home', False, '/%s/default/index'
|
|
||||||
% request.application], ['docs', True,
|
|
||||||
'/%s/global/vars' % request.application]]
|
|
||||||
|
|
||||||
def get(args):
|
def get(args):
|
||||||
if args[0].startswith('__'):
|
if args[0].startswith('__'):
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -54,13 +54,6 @@ def raisehttp():
|
|||||||
raise HTTP(400, 'internal error')
|
raise HTTP(400, 'internal error')
|
||||||
|
|
||||||
|
|
||||||
def raiseexception():
|
|
||||||
""" generates an exeption, logs the event and returns a ticket number """
|
|
||||||
|
|
||||||
1 / 0
|
|
||||||
return 'oops'
|
|
||||||
|
|
||||||
|
|
||||||
def servejs():
|
def servejs():
|
||||||
""" serves a js document """
|
""" serves a js document """
|
||||||
|
|
||||||
@@ -69,7 +62,6 @@ def servejs():
|
|||||||
gluon.contenttype.contenttype('.js')
|
gluon.contenttype.contenttype('.js')
|
||||||
return 'alert("This is a Javascript document, it is not supposed to run!");'
|
return 'alert("This is a Javascript document, it is not supposed to run!");'
|
||||||
|
|
||||||
|
|
||||||
def makejson():
|
def makejson():
|
||||||
import gluon.contrib.simplejson as sj
|
import gluon.contrib.simplejson as sj
|
||||||
return sj.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
|
return sj.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from gluon.contrib.spreadsheet import Sheet
|
from gluon.contrib.spreadsheet import Sheet
|
||||||
|
|
||||||
|
|
||||||
def callback():
|
def callback():
|
||||||
return cache.ram('sheet1', lambda: None, None).process(request)
|
return cache.ram('sheet1', lambda: None, None).process(request)
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><a class="btn btn-180 btn-success" href="http://www.web2py.com/examples/static/web2py_src.zip">Source Code</a></td>
|
<td><a class="btn btn-180 btn-success" href="http://www.web2py.com/examples/static/web2py_src.zip">Source Code</a></td>
|
||||||
<td><a class="btn btn-180 btn-warning" href="http://www.web2py.com/examples/static/nightly/web2py_src.zip">Source Code</a></td>
|
<td><a class="btn btn-180 btn-warning" href="http://www.web2py.com/examples/static/nightly/web2py_src.zip">Source Code</a></td>
|
||||||
<td><a class="btn btn-180 btn-danger" href="{{=URL('static', 'epydoc/index.html')}}">Source Code Docs</a></td>
|
<td><a class="btn btn-180 btn-danger" href="{{=URL('static', 'epydoc/index.html')}}">Epydoc</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><a class="btn btn-180 btn-success" href="https://dl.dropbox.com/u/18065445/web2py/web2py_manual_5th.pdf">Manual</a></td>
|
||||||
<td><a class="btn btn-180" href="{{=URL('changelog')}}">Change Log</a></td>
|
<td><a class="btn btn-180" href="{{=URL('changelog')}}">Change Log</a></td>
|
||||||
<td><a class="btn btn-180" href="http://code.google.com/p/web2py/issues/list">Report a Bug</a></td>
|
<td><a class="btn btn-180" href="http://code.google.com/p/web2py/issues/list">Report a Bug</a></td>
|
||||||
<td></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ def raiseexception():
|
|||||||
return 'oops'
|
return 'oops'
|
||||||
""".strip(),language='web2py',link=URL('global','vars'),_class='boxCode')}}
|
""".strip(),language='web2py',link=URL('global','vars'),_class='boxCode')}}
|
||||||
<p>If an exception occurs (other than HTTP) a ticket is generated and the event is logged for the administrator. These tickets and logs can be accessed, reviewed and deleted at any later time.
|
<p>If an exception occurs (other than HTTP) a ticket is generated and the event is logged for the administrator. These tickets and logs can be accessed, reviewed and deleted at any later time.
|
||||||
<br/>Try it here: <a href="/{{=request.application}}/simple_examples/raiseexception">raiseexception</a></p>
|
|
||||||
|
|
||||||
<h3>Example {{=c}}{{c+=1}}</h3><b>In controller: simple_examples.py</b>
|
<h3>Example {{=c}}{{c+=1}}</h3><b>In controller: simple_examples.py</b>
|
||||||
{{=CODE("""
|
{{=CODE("""
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ random.shuffle(quotes)
|
|||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<h3>web2py<sup>TM</sup> Web Framework</h3>
|
<h3>web2py<sup>TM</sup> Web Framework</h3>
|
||||||
<p>Free open source full-stack framework for rapid development of fast, scalable, <a href="http://www.web2py.com/book/default/chapter/01#Security" target="_blank">secure</a> and portable database-driven web-based applications. Written and programmable in <a href="http://www.python.org" target="_blank">Python</a>. <a href="http://www.gnu.org/licenses/lgpl.html">LGPLv3 License</a>.</p>
|
<p>Free open source full-stack framework for rapid development of fast, scalable, <a href="http://www.web2py.com/book/default/chapter/01#Security" target="_blank">secure</a> and portable database-driven web-based applications. Written and programmable in <a href="http://www.python.org" target="_blank">Python</a>.</p>
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@@ -37,7 +37,7 @@ random.shuffle(quotes)
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>Current version: <a href="{{=URL('download')}}">{{=request.env.web2py_version}}</p>
|
<p>Current version: <a href="{{=URL('download')}}">{{=request.env.web2py_version}} (<a href="http://www.gnu.org/licenses/lgpl.html">LGPLv3 License</a>)</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="span4" style="text-align:center">
|
<div class="span4" style="text-align:center">
|
||||||
<a href="http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-of-the-year-award-winners-183313#slide23"><img src="{{=URL('static','images/infoworld2012.jpeg')}}" width="200px"/></a><br/>
|
<a href="http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-of-the-year-award-winners-183313#slide23"><img src="{{=URL('static','images/infoworld2012.jpeg')}}" width="200px"/></a><br/>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<br/>
|
<br/>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
|
|
||||||
{{if doc:}}<br/><br/>{{=CODE(str(doc),language=None,counter=None,_class='boxCode')}}{{pass}}
|
{{if doc:}}<br/><br/>{{=MARKMIN(doc)}}{{pass}}
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<div class="boxInfo">
|
<div class="boxInfo">
|
||||||
{{if attributes:}}
|
{{if attributes:}}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{if key.count('.')<2:}}
|
{{if key.count('.')<2:}}
|
||||||
{{=A(key,_href=URL(args=key.split('.')))}}
|
{{=A(key,_rel="nofollow",_href=URL(args=key.split('.')))}}
|
||||||
{{else:}}
|
{{else:}}
|
||||||
{{=key}}
|
{{=key}}
|
||||||
{{pass}}
|
{{pass}}
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
{{if c1:}} belongs to class {{=c1}}{{pass}}
|
{{if c1:}} belongs to class {{=c1}}{{pass}}
|
||||||
<br/>
|
<br/>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
{{if doc1:}}{{=XML(cgi.escape(str(doc1)).replace(chr(13),'<br/>'))}}{{pass}}
|
{{if doc1:}}{{=MARKMIN(doc1)}}{{pass}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan=2><hr/></td></tr>
|
<tr><td colspan=2><hr/></td></tr>
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
{{extend 'layout.html'}}
|
{{extend 'layout.html'}}
|
||||||
|
<style>
|
||||||
|
input {width: 70px;}
|
||||||
|
input:focus {background-color: yellow}
|
||||||
|
table, td, tr { border: 0; margin: 0; padding: 0}
|
||||||
|
</style>
|
||||||
<h1>Excel-like spreadsheet widget</h1>
|
<h1>Excel-like spreadsheet widget</h1>
|
||||||
|
|
||||||
Try insert "=r0c1+1" in cell r0c0 and "2" in r0c1. Formulas start with "=" as in Excel. You can use a subset of python commands and math function, and reference cells by r[row]c[col]. All computations are performed serverside via Ajax (input is validated for security). Cell values and formulas can be set and locked serverside. The shape of the spreadsheet can be modifed serverside and does not need to be tabular (think of it as a graph of css-friendly widgets you can place where you want). Cells can be given arbistrary names. This example is distributed with web2py so look at the source code of the example to learn more.
|
Try insert "=r0c1+1" in cell r0c0 and "2" in r0c1. Formulas start with "=" as in Excel. You can use a subset of python commands and math function, and reference cells by r[row]c[col]. All computations are performed serverside via Ajax (input is validated for security). Cell values and formulas can be set and locked serverside. The shape of the spreadsheet can be modifed serverside and does not need to be tabular (think of it as a graph of css-friendly widgets you can place where you want). Cells can be given arbistrary names. This example is distributed with web2py so look at the source code of the example to learn more.
|
||||||
|
|||||||
Reference in New Issue
Block a user