When I try to use the suggested decorator I get this error:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/gluon/restricted.py", line 192, in restricted
exec ccode in environment
File "/xxxxx/xxxx/xxxxx/xxx/xxxx/xxxx/GlobaLeaks/globaleaks/
applications/globaleaks/controllers/submission.py", line 317, in
<module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/gluon/globals.py", line 145, in <lambda>
self._caller = lambda f: f()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/gluon/globals.py", line 107, in f
rest_action = _action().get(method,None)
AttributeError: 'NoneType' object has no attribute 'get'
What could this depend on?
I looks like an error in web2py code.
Is it safe to use request.restful() now?
Or is it something still being experimented and maybe I should wait
some time before having it in productions?
- Art.
On Oct 13, 2:57 am, Massimo Di Pierro <[email protected]>
wrote:
> Writing it.... It may change but not too much.
>
> On Oct 12, 7:40 pm, ~redShadow~ <[email protected]> wrote:
>
>
>
>
>
>
>
> > On Wed, 2011-10-12 at 17:25 -0700, Massimo Di Pierro wrote:
> > > [..cut..]
>
> > I've already seen this example somewhere (is it in the book?) but it
> > looks like the whole REST-server thing is quite undocumented and not
> > advertised as it should.. is that just experimental and might change in
> > the future? Or, is it just undocumented?
>
> > > patterns = [
> > > "/friends[person]",
> > > "/friend/{person.name.startswith}",
> > > "/friend/{person.name}/:field",
> > > "/friend/{person.name}/pets[pet.owner]",
> > > "/friend/{person.name}/pet[pet.owner]/{pet.name}",
> > > "/friend/{person.name}/pet[pet.owner]/{pet.name}/:field"
> > > ]
> > > parser = db.parse_as_rest(patterns,args,vars)
>
> > This patterns auto-parsing mechanism looks cool, but I didn't understand
> > the exact behavior of different patterns. Quick explanation of how these
> > work?
>
> > --
> > Samuele ~redShadow~ Santi
> > ----------------------------------------------------------------
> > redshadow[at]hackzine.org - redshadowhack[at]gmail.com
>
> > Blog:http://hackzine.org
>
> > GPG Key signature:
> > 050D 3E9F 6E0B 44CE C008 D1FC 166C 3C7E EB26 4933
> > ----------------------------------------------------------------
> > /me recommends:
> > Squadra Informatica -http://www.squadrainformatica.com
> > ----------------------------------------------------------------
> > - Proud ThinkPad T-Series owner
> > - Registered Linux-User: #440008
> > * GENTOO User since 1199142000 (2008-01-01)
> > * former DEBIAN SID user
> > ----------------------------------------------------------------
> > "Software is like sex: it's better when it's free!"
> > -- Linus Torvalds
>
> > signature.asc
> > < 1KViewDownload