I have been working on this this morning and YES, there is a bug. But
there is more than that. The syntax I proposed before was
http://.../app/controller/function/arg0/arg1/.../argN.extension
The problem is that works only if no args else there is ambiguity on
whether the extension belongs to the function or to the argN. This of
http://..../admin/default/edit/filename.xml
Do we want the to edit "filename.xml" or to we want to serialize the
function edit in xml?
I tentatively made it work on trunk by changing the notation into
http://.../app/controller/function.extension/arg0/arg1/.../argN
(it is backward compatible since the previous did not work if args
were present, moreover extension defaults always to html).
This is tentatively in the trunk and you can do (assuming a table
'xxx')
def select(): return dict(items=crud.select(request.args(0)))
# http://127.0.0.1:8000/app/default/select.html/xxx
# http://127.0.0.1:8000/app/default/select.xml/xxx
def read(): return dict(item=crud.read(request.args(0),request.args
(1)))
# http://127.0.0.1:8000/app/default/read.html/xxx/1
# http://127.0.0.1:8000/app/default/read.xml/xxx/1
def data(): return dict(data=crud())
# http://127.0.0.1:8000/app/default/data.html/select/xxx
# http://127.0.0.1:8000/app/default/data.xml/select/xxx
# http://127.0.0.1:8000/app/default/data.html/read/xxx/1
# http://127.0.0.1:8000/app/default/data.xml/read/xxx/1
Comments? Pros? Cons?
Massimo
On Jun 12, 11:36 am, pk <[email protected]> wrote:
> I still get Invalid function
> I don`t know what i have to do that this will work
>
> On 12 Jun., 18:22, mdipierro <[email protected]> wrote:
>
> > try:
>
> > def select(): return crud.select()
>
> >http://127.0.0.1:8000/[app]/default/select/[tablename]/whatever.xml
>
> > this should work although it is "experimental" because it is using a
> > default serializer on your own data. You would have do define your own
> > serializer.
>
> > Massimo
>
> > On Jun 12, 8:56 am, pk <[email protected]> wrote:
>
> > > but i get an empty page if i
> > > tryhttp://127.0.0.1:8000/2busy/default/data/project/select.xml
>
> > > here the code in my model:
> > > from gluon.tools import Mail, Auth, Crud, Service # new in web2py
> > > 1.56
> > > service = Service(globals())
>
> > > crud = Crud(globals(),db)
>
> > > def data(): return crud()
>
> > > On 12 Jun., 15:40, DenesL <[email protected]> wrote:
>
> > > > See example in cookbook2 slide 50.
>
> > > > Cookbook2:http://groups.google.com/group/web2py/msg/fcd6aa1687410501
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---