The correct syntax as far as the wiki is concerned is
@{join:a,b,c}
The problem is that MARKMIN identifies the call to "join" and the args
"a,b,c" but it does not parse the args. You will have to do that:
def myjoin(vars):
items = vars.split(',')
if len(items)==3: return '-'.join(items)
return 'Error!'
def index():
return auth.wiki(env=dict(join=myjoin)
On Tuesday, 16 July 2013 17:27:30 UTC-5, dhmorgan wrote:
>
> I'm experimenting with auth.wiki() using the book's instructions; using
> web2py 2.60; created new simple app ("authwiki") via the admin wizard
>
>
> I'm attempting to utilize "@(join:a,b,c)" in the body of my wiki page,
> having first set the controller to return auth.wiki(env=dict(join=lambda
> a,b,c:"%s-%s-%s" % (a,b,c)))
>
> "@(join:a,b,c)" goes unrendered, as does "@join:a,b,c"
>
> "@{join:a,b,c}" and "@{join:(a,b,c)} both produce an error indicating:
>
> ERROR: <lambda>() takes exactly 3 arguments (1 given)
>
>
> In controllers/default.py:
>
> def index():
> return auth.wiki(env=dict(join=lambda a,b,c:"%s-%s-%s" % (a,b,c)))
>
>
> I also tried the same using "extra" instead of "env" in the auth.wiki()
> call and got the same or similar results.
>
>
> This is the actual body text:
>
> - brackets and colon
>
> @{join:'how','you','doin'}
>
> - brackets, colon and parenths
>
> @{join:('how','you','doin')}
>
> - parentheses and colon
>
> @(join:'how','you','doin')
>
> - colon only
>
> @join:'how','you','doin'
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.