This is a blockquote with a list with tables in it:
This is a paragraph before list. You can continue paragraph on the next lines. This is an ordered list with tables:
Item 1
Item 2
aa
bb
cc
11
22
33
Item 4
T1
T2
t3
aaa
bbb
ccc
ddd
fff
ggg
123
0
5.0
This this a new paragraph with a table. Table has header, footer, sections, odd and even rows:
Title 1
Title 2
Title 3
data 1
data 2
2.00
data 3
data4(long)
23.00
data 5
33.50
New section
New data
5.00
data 1
data2(long)
100.45
data 3
12.50
data 4
data 5
.33
data 6
data7(long)
8.01
data 8
514
Total:
9 items
698,79
Multilevel lists
Now lists can be multilevel:
Ordered item 1 on level 1. You can continue item text on next strings
Ordered item 1 of sublevel 2 with a paragraph (paragraph can start with point after plus or minus characters, e.g. ++. or --.)
This is another item. But with 3 paragraphs, blockquote and sublists:
This is the second paragraph in the item. You can add paragraphs to an item, using point notation, where first characters in the string are sequence of points with space between them and another string. For example, this paragraph (in sublevel 2) starts with two points:
.. This is the second paragraph...
this is a blockquote in a list
You can use blockquote with headers, paragraphs, tables and lists in it: Tables can have or have not header and footer. This table is defined without any header and footer in it:
red
fox
0
blue
dolphin
1000
green
leaf
10000
This is yet another paragraph in the item.
This is an item of unordered list (sublevel 3)
This is the second item of the unordered list (sublevel 3)
This is a single item of ordered list in sublevel 6
and this is a paragraph in sublevel 4
This is a new item with paragraph in sublevel 3.
Start ordered list in sublevel 4 with code block:
line 1
- line 2
- line 3
Yet another item with code block:
line 1
-line 2
- line 3
This item finishes with this paragraph.
Item in sublevel 3 can be continued with paragraphs.
this is another
-code block
- in the
- sublevel 3 item
The last item in sublevel 3
This is a continuous paragraph for item 2 in sublevel 2. You can use such structure to create difficult structured documents.
item 3 in sublevel 2
item 1 in sublevel 2 (new unordered list)
item 2 in sublevel 2
item 3 in sublevel 2
item 1 in sublevel 2 (new ordered list)
item 2 in sublevel 2
item 3 in sublevle 2
item 2 in level 1
item 3 in level 1
new unordered list (item 1 in level 1)
level 2 in level 1
level 3 in level 1
level 4 in level 1
This is the last section of the test
Single paragraph with '----' in it will be turned into separator:
And this is the last paragraph in the test. Be happy!
====================
Why?
We wanted a markup language with the following requirements:
less than 300 lines of functional code
easy to read
secure
support table, ul, ol, code
support html5 video and audio elements (html serialization only)
can align images and resize them
can specify class for tables and code elements
can add anchors
does not use _ for markup (since it creates odd behavior)
automatically links urls
fast
easy to extend
supports latex and pdf including references
allows to describe the markup in the markup (this document is generated from markmin syntax)
(results depend on text but in average for text ~100K markmin is 30% faster than markdown, for text ~10K it is 10x faster)
The web2py book published by lulu, for example, was entirely generated with markmin2pdf from the online web2py wiki
The format is always [[title link]] or [[title [extra] link]]. Notice you can nest bold, italic, strikeout and code inside the link title.
Anchors
You can place an anchor anywhere in the text using the syntax [[name]] where name is the name of the anchor. You can then link the anchor with link, i.e. [[link #myanchor]] or link with an extra info, i.e. [[link with an extra info [extra info] #myanchor]].
Images
This paragraph has an image aligned to the right with a width of 200px. Its is placed using the code
[[alt-string for the image [the image title] http://www.web2py.com/examples/static/web2py_logo.png right 200px]].
Unordered Lists
- Dog
+print markmin2pdf(m)
+
+
Why?
We wanted a markup language with the following requirements:
less than 300 lines of functional code
easy to read
secure
support table, ul, ol, code
support html5 video and audio elements (html serialization only)
can align images and resize them
can specify class for tables and code elements
can add anchors
does not use _ for markup (since it creates odd behavior)
automatically links urls
fast
easy to extend
supports latex and pdf including references
allows to describe the markup in the markup (this document is generated from markmin syntax)
(results depend on text but in average for text ~100K markmin is 30% faster than markdown, for text ~10K it is 10x faster)
The web2py book published by lulu, for example, was entirely generated with markmin2pdf from the online web2py wiki
The format is always [[title link]] or [[title [extra] link]]. Notice you can nest bold, italic, strikeout and code inside the link title.
Anchors
You can place an anchor anywhere in the text using the syntax [[name]] where name is the name of the anchor. You can then link the anchor with link, i.e. [[link #myanchor]] or link with an extra info, i.e. [[link with an extra info [extra info] #myanchor]].
Images
This paragraph has an image aligned to the right with a width of 200px. Its is placed using the code
[[alt-string for the image [the image title] http://www.web2py.com/examples/static/web2py_logo.png right 200px]].
Unordered Lists
- Dog
- Cat
- Mouse
is rendered as
Dog
Cat
Mouse
Two new lines between items break the list in two lists.
Citations are treated as internal links in html and proper citations in latex if there is a final section called "References". Items like
- [[key]] value
in the References will be translated into Latex
\bibitem{key} value
Here is an example of usage:
As shown in Ref.``mdipierro``:cite
+
This is a test block with new features:
This is a blockquote with a list with tables in it:
This is a paragraph before list. You can continue paragraph on the next lines. This is an ordered list with tables:
Item 1
Item 2
aa
bb
cc
11
22
33
Item 4
T1
T2
t3
aaa
bbb
ccc
ddd
fff
ggg
123
0
5.0
This this a new paragraph with a table. Table has header, footer, sections, odd and even rows:
Title 1
Title 2
Title 3
data 1
data 2
2.00
data 3
data4(long)
23.00
data 5
33.50
New section
New data
5.00
data 1
data2(long)
100.45
data 3
12.50
data 4
data 5
.33
data 6
data7(long)
8.01
data 8
514
Total:
9 items
698,79
Multilevel lists
Now lists can be multilevel:
Ordered item 1 on level 1. You can continue item text on next strings
Ordered item 1 of sublevel 2 with a paragraph (paragraph can start with point after plus or minus characters, e.g. ++. or --.)
This is another item. But with 3 paragraphs, blockquote and sublists:
This is the second paragraph in the item. You can add paragraphs to an item, using point notation, where first characters in the string are sequence of points with space between them and another string. For example, this paragraph (in sublevel 2) starts with two points:
.. This is the second paragraph...
this is a blockquote in a list
You can use blockquote with headers, paragraphs, tables and lists in it: Tables can have or have not header and footer. This table is defined without any header and footer in it:
red
fox
0
blue
dolphin
1000
green
leaf
10000
This is yet another paragraph in the item.
This is an item of unordered list (sublevel 3)
This is the second item of the unordered list (sublevel 3)
This is a single item of ordered list in sublevel 6
and this is a paragraph in sublevel 4
This is a new item with paragraph in sublevel 3.
Start ordered list in sublevel 4 with code block:
line 1
+ line 2
+ line 3
Yet another item with code block:
line 1
+line 2
+ line 3
This item finishes with this paragraph.
Item in sublevel 3 can be continued with paragraphs.
this is another
+code block
+ in the
+ sublevel 3 item
The last item in sublevel 3
This is a continuous paragraph for item 2 in sublevel 2. You can use such structure to create difficult structured documents.
item 3 in sublevel 2
item 1 in sublevel 2 (new unordered list)
item 2 in sublevel 2
item 3 in sublevel 2
item 1 in sublevel 2 (new ordered list)
item 2 in sublevel 2
item 3 in sublevle 2
item 2 in level 1
item 3 in level 1
new unordered list (item 1 in level 1)
level 2 in level 1
level 3 in level 1
level 4 in level 1
This is the last section of the test
Single paragraph with '----' in it will be turned into separator:
And this is the last paragraph in the test. Be happy!
{{=T.M("Number of entries: **%s**", total['entries'])}}
@@ -210,6 +212,8 @@
{{pass}}
+{{pass}}
+
{{=T("Manage Cache")}}
diff --git a/examples/routes.parametric.example.py b/examples/routes.parametric.example.py
index 714a5a0a..9518ed46 100644
--- a/examples/routes.parametric.example.py
+++ b/examples/routes.parametric.example.py
@@ -48,9 +48,11 @@
# default_language
# The language code (for example: en, it-it) optionally appears in the URL following
# the application (which may be omitted). For incoming URLs, the code is copied to
-# request.language; for outgoing URLs it is taken from request.language.
+# request.uri_language; for outgoing URLs it is taken from request.uri_language.
# If languages=None, language support is disabled.
# The default_language, if any, is omitted from the URL.
+# To use the incoming language in your application, add this line to one of your models files:
+# if request.uri_language: T.force(request.uri_language)
# root_static: list of static files accessed from root (by default, favicon.ico & robots.txt)
# (mapped to the default application's static/ directory)
# Each default (including domain-mapped) application has its own root-static files.
diff --git a/gluon/compileapp.py b/gluon/compileapp.py
index d0f5bc10..cec75ea2 100644
--- a/gluon/compileapp.py
+++ b/gluon/compileapp.py
@@ -528,7 +528,7 @@ def run_models_in(environment):
models_to_run = None
for model in models:
if response.models_to_run != models_to_run:
- regex = models_to_run = response.models_to_run
+ regex = models_to_run = response.models_to_run[:]
if isinstance(regex, list):
regex = re_compile('|'.join(regex))
if models_to_run:
diff --git a/gluon/contrib/login_methods/rpx_account.py b/gluon/contrib/login_methods/rpx_account.py
index 0cd1c56a..d8c47eb6 100644
--- a/gluon/contrib/login_methods/rpx_account.py
+++ b/gluon/contrib/login_methods/rpx_account.py
@@ -98,27 +98,32 @@ class RPXAccount(object):
def login_form(self):
request = self.request
args = request.args
- if self.embed:
- JANRAIN_URL = \
- "https://%s.rpxnow.com/openid/embed?token_url=%s&language_preference=%s"
- rpxform = IFRAME(
- _src=JANRAIN_URL % (
- self.domain, self.token_url, self.language),
- _scrolling="no",
- _frameborder="no",
- _style="width:400px;height:240px;")
- else:
- JANRAIN_URL = \
- "https://%s.rpxnow.com/openid/v2/signin?token_url=%s"
- rpxform = DIV(SCRIPT(_src="https://rpxnow.com/openid/v2/widget",
- _type="text/javascript"),
- SCRIPT("RPXNOW.overlay = true;",
- "RPXNOW.language_preference = '%s';" % self.language,
- "RPXNOW.realm = '%s';" % self.domain,
- "RPXNOW.token_url = '%s';" % self.token_url,
- "RPXNOW.show();",
- _type="text/javascript"))
- return rpxform
+ rpxform = """
+
+ """ % (self.token_url, self.domain, self.domain)
+ return XML(rpxform)
def use_janrain(auth, filename='private/janrain.key', **kwargs):
diff --git a/gluon/contrib/populate.py b/gluon/contrib/populate.py
index 122a4d64..2930d119 100644
--- a/gluon/contrib/populate.py
+++ b/gluon/contrib/populate.py
@@ -266,5 +266,5 @@ def populate_generator(table, default=True, compute=False, contents={}):
if __name__ == '__main__':
ell = Learner()
- ell.loadd(eval(IUP))
+ ell.loadd(IUP)
print ell.generate(1000, prefix=None)
diff --git a/gluon/dal.py b/gluon/dal.py
index 3d7b33d2..2ac4c8b6 100644
--- a/gluon/dal.py
+++ b/gluon/dal.py
@@ -8189,8 +8189,8 @@ def index():
limits = (offset,long(vars.get('limit',None) or 1000)+offset)
except ValueError:
return Row({'status':400,'error':'invalid limits','response':None})
- if count > limits[1]-limits[0]:
- return Row({'status':400,'error':'too many records','response':None})
+ #if count > limits[1]-limits[0]:
+ # return Row({'status':400,'error':'too many records','response':None})
try:
response = dbset.select(limitby=limits,orderby=orderby,*fields)
except ValueError:
@@ -8453,6 +8453,9 @@ def index():
columns = adapter.cursor.description
# reduce the column info down to just the field names
fields = colnames or [f[0] for f in columns]
+ if len(fields) != len(set(fields)):
+ raise RuntimeError("Result set includes duplicate column names. Specify unique column names using the 'colnames' argument")
+
# will hold our finished resultset in a list
data = adapter._fetchall()
# convert the list for each row into a dictionary so it's
diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py
index 2a417c78..9bc86c4e 100644
--- a/gluon/sqlhtml.py
+++ b/gluon/sqlhtml.py
@@ -3204,7 +3204,8 @@ class ExporterHTML(ExportClass):
ExportClass.__init__(self, rows)
def export(self):
- return '\n\n\n\n\n%s\n\n' % (self.rows.xml() or '')
+ xml = self.rows.xml() if self.rows else ''
+ return '\n\n\n\n\n%s\n\n' % (xml or '')
class ExporterXML(ExportClass):
label = 'XML'
diff --git a/gluon/tools.py b/gluon/tools.py
index b0d4d3a5..0dbecb1e 100644
--- a/gluon/tools.py
+++ b/gluon/tools.py
@@ -2112,7 +2112,7 @@ class Auth(object):
success = False
if row:
userfield = self.settings.login_userfield or 'username' \
- if 'username' in table_user.fields else 'email'
+ if 'username' in table.fields else 'email'
# If ticket is a service Ticket and RENEW flag respected
if ticket[0:3] == 'ST-' and \
not ((row.renew and renew) ^ renew):
@@ -5893,7 +5893,7 @@ class Wiki(object):
class Config(object):
def __init__(
self,
- filename,
+ filename,
section,
default_values={}
):
diff --git a/gluon/validators.py b/gluon/validators.py
index 0107e43a..1bf11af4 100644
--- a/gluon/validators.py
+++ b/gluon/validators.py
@@ -458,7 +458,7 @@ class IS_IN_SET(Validator):
regex1 = re.compile('\w+\.\w+')
-regex2 = re.compile('%\((?P[^\)]+)\)s')
+regex2 = re.compile('%\((?P[^\)]+)\)(\d*\.\d*)?[a-zA-Z]')
class IS_IN_DB(Validator):