[web2py] Re: parse_as_rest queries

2013-01-15 Thread Massimo Di Pierro
This may affect other concurrent apps which use this adapter. Not sure. On Monday, 14 January 2013 19:31:52 UTC-6, DenesL wrote: > > > This also seems to work: > > db._adapter.parse_blob=lambda value,field_type: value > > Any cons?. > --

[web2py] Re: parse_as_rest queries

2013-01-14 Thread DenesL
This also seems to work: db._adapter.parse_blob=lambda value,field_type: value Any cons?. --

[web2py] Re: parse_as_rest queries

2013-01-14 Thread DenesL
Thank you. On Sunday, January 13, 2013 11:52:19 PM UTC-5, Massimo Di Pierro wrote: > > web2py uses b64encode/decode to store/retrieve data in blobs. Legacy > tables probably do not do it. > > You need you make your own custom adapter to override a method. For > example for PostgreSQL: > > from

[web2py] Re: parse_as_rest queries

2013-01-13 Thread Massimo Di Pierro
web2py uses b64encode/decode to store/retrieve data in blobs. Legacy tables probably do not do it. You need you make your own custom adapter to override a method. For example for PostgreSQL: from gluon.dal import ADAPTERS, UseDatabaseStoredFile,PostgreSQLAdapter class MyPostgresAdapter(PostgreS

[web2py] Re: parse_as_rest queries

2013-01-13 Thread DenesL
Suggestions to override parse_blob are welcome. --

[web2py] Re: parse_as_rest queries

2013-01-13 Thread DenesL
It seems to be from the data, it is a legacy table. Using 4607 trunk a manual select gives: Traceback (most recent call last): File "", line 1, in File "C:\w2p\trunk\gluon\dal.py", line 9181, in select return adapter.select(self.query,fields,attributes) File "C:\w2p\trunk\gluon\dal.py"

[web2py] Re: parse_as_rest queries

2013-01-13 Thread Massimo Di Pierro
I have fixed the first error too but not sure where the second comes from. Can you help? On Sunday, 13 January 2013 09:25:13 UTC-6, DenesL wrote: > > Thank you, it still needs more work: > > Traceback (most recent call last): > File "C:\w2p\trunk\gluon\restricted.py", line 212, in restricted >

[web2py] Re: parse_as_rest queries

2013-01-13 Thread DenesL
Thank you, it still needs more work: Traceback (most recent call last): File "C:\w2p\trunk\gluon\restricted.py", line 212, in restricted exec ccode in environment File "C:\w2p\trunk\applications\test\controllers/rest.py", line 28, in File "C:\w2p\trunk\gluon\globals.py", line 193, in

[web2py] Re: parse_as_rest queries

2013-01-09 Thread Massimo Di Pierro
I have implemented what you requested: patterns = [ ('/dogs[pet]', db.pet.kind=='dog') ] Can you please check it? On Monday, 31 December 2012 11:30:34 UTC-6, DenesL wrote: > > +1 for an extended syntax instead of routes. > > Blog post about http://blog.2partsmagic.com/restful-uri-design/ which

[web2py] Re: parse_as_rest queries

2013-01-02 Thread Massimo Di Pierro
I think this can be implemented. Will try later today. On Monday, 31 December 2012 11:30:34 UTC-6, DenesL wrote: > > +1 for an extended syntax instead of routes. > > Blog post about http://blog.2partsmagic.com/restful-uri-design/ which > discusses some schemes (about halfway down, with the title

[web2py] Re: parse_as_rest queries

2013-01-02 Thread DenesL
^bump^ --

[web2py] Re: parse_as_rest queries

2012-12-31 Thread DenesL
+1 for an extended syntax instead of routes. Blog post about http://blog.2partsmagic.com/restful-uri-design/ which discusses some schemes (about halfway down, with the title "Choosing a URI schemes for resource hierarchies" (sic)). One thing to think about is how to define the creation of new r

[web2py] Re: parse_as_rest queries

2012-12-29 Thread Massimo Di Pierro
It could be possible via routes but it would be nice it the syntax were to allow it. I stopped developing it because I though instead of reinventing the wheel with this syntax we may want to support some standard. Is there any? On Sunday, 30 December 2012 00:01:03 UTC-6, DenesL wrote: > > Yes,

[web2py] Re: parse_as_rest queries

2012-12-29 Thread DenesL
Yes, from the docs it is clear that one could use such syntax but the idea is to hide it somehow. So instead of /pets/dog I want just /dogs Note that I am providing all parameters for the query in the pseudo-code {pet.kind.eq.dog} to avoid having another arg. On Saturday, December 29, 2012 12:4

[web2py] Re: parse_as_rest queries

2012-12-29 Thread Massimo Di Pierro
you can say something like: "/pets[pet]/{pet.kind.eq}" and call /pets/dog or /pets/cat It is not documented because I am convinced this syntax is definitive. It needs more etsting and as you suggest it may be richer. massimo On Saturday, 29 December 2012 11:32:25 UTC-6, DenesL wrote: > > Hi