fix editing mistakes

This commit is contained in:
Richard Boß
2018-04-17 22:17:01 +02:00
parent 8d4dc1b373
commit 77ebad50e3
2 changed files with 4 additions and 4 deletions

View File

@@ -390,7 +390,7 @@ db.purchase.quantity.requires = IS_INT_IN_RANGE(0, 10)
""".strip(),language='web2py',link=URL('global','vars'),_class='boxCode')}}
<p>
Tables are created if they do not exist (try... except).
Here "purchased" is an Query object, "db(purchased)" would be a Set objects. A Set object can be selected, updated, deleted. Sets can also be intersected. Allowed field types are string, integer, password, text, blob, upload, date, time, datetime, references(*), and id(*). The id field is there by default and must not be declared. references are for one to many and many to many as in the example above. For strings you should specify a length or you get length=32.<br/><br/>
Here "purchased" is an Query object, "db(purchased)" would be a Set objects. A Set object can be selected, updated, deleted. Sets can also be intersected. Allowed field types are string, integer, password, text, blob, upload, date, time, datetime, references(*), and id(*). The id field is there by default and must not be declared. References are for one to many and many to many as in the example above. For strings you should specify a length or you get length=32.<br/><br/>
You can use db.tablename.fieldname.requires= to set restrictions on the field values. These restrictions are automatically converted into widgets when generating forms from the table with SQLFORM(db.tablename).
<br/><br/>
define_tables creates the table and attempts a migration if table has changed or if database name has changed since last time. If you know you already have the table in the database and you do not want to attempt a migration add one last argument to define_table <tt>migrate=False</tt>.</p>
@@ -551,7 +551,7 @@ def cache_controller_and_view():
d=dict(time=t,link=A('click to reload',_href=URL(r=request)))
return response.render(d)
""".strip(),language='web2py',link=URL('global','vars'),_class='boxCode')}}
<p><tt>response.render(d)</tt> renders the dictionary inside the controller, so everything is cached now for 5 seconds. This is best and fastest way of caching!
<p><tt>response.render(d)</tt> renders the dictionary inside the controller, so everything is cached now for 5 seconds. This is the best and fastest way of caching!
<br/>Try it here: <a class="btn" href="/{{=request.application}}/cache_examples/cache_controller_and_view">cache_controller_and_view</a></p>
<h3>Example {{=c}}{{c+=1}}</h3><b>In controller: cache_examples.py </b>
@@ -640,7 +640,7 @@ def streamer():
<h2 id="xmlrpc_examples">XML-RPC Examples</h2>
<h3>Example {{=c}}{{c+=1}}</h3>
<p>Web2py has native support for the XMLRPC protocol. Below is a controller function "handler" that exposes two functions, "add" and "sub" via XMLRPC. The controller "tester" executes the two function remotely via xmlrpc.</p>
<p>Web2py has native support for the XMLRPC protocol. Below is a controller function "handler" that exposes two functions, "add" and "sub" via XMLRPC. The controller "tester" executes the two functions remotely via xmlrpc.</p>
{{=CODE("""
from gluon.tools import Service
service = Service(globals())

View File

@@ -149,7 +149,7 @@
<li><a href="http://www.python.org">Python</a> created by Guido van Rossum.</li>
<li>Rocket Web Server developed by Timothy Farrell.</li>
<li><a href="http://codemirror.net/">CodeMirror</a></li>s
<li><a href="http://codemirror.net/">CodeMirror</a></li>
<li><a href="http://pyrtf.sourceforge.net/">PyRTF</a> developed by Simon Cusack and revised by Grant Edwards</li>
<li><a href="http://www.dalkescientific.com/Python/PyRSS2Gen.html">PyRSS2Gen</a> developed by Dalke Scientific Software</li>
<li><a href="http://www.feedparser.org/">feedparser</a> developed by Mark Pilgrim</li>