Thanks Anthony,

Seems that "experimental" RESTful feature is exactly what I was looking 
for. The controller action approach got really ugly really fast, thus why I 
was looking for a more elegant approach :)


On Monday, March 12, 2012 10:39:27 AM UTC-4, Anthony wrote:
>
> Check out the RESTful web services functionality: 
> http://web2py.com/books/default/chapter/29/10#Restful-Web-Services, in 
> particular, 
> http://web2py.com/books/default/chapter/29/10#parse_as_rest-(experimental)
> .
>
> You could also handle this specific case in a controller action, with all 
> the elements of your URL in request.args:
>
> In default.py:
>
> def TopThing():
>     rows = db((db.TopThing.id == db.MiddleThing.TopThing_id) &
>               (db.MiddleThing.id == db.BottomThing.MiddleThing_id) &
>               (db.TopThing.id == request.args(0)) &
>               (db.MiddleThing.id = request.args(2))).select()
>     return dict(rows=rows)
>
> Anthony
>
> On Monday, March 12, 2012 10:05:31 AM UTC-4, rdodev wrote:
>>
>> Hello all,
>>
>> I'm fairly knew to web2py and trying to find things out by myself as much 
>> as I can. However, I have not been able to find how to create 
>> logical/relationship URLs. Let's say I have a model named TopThing, which 
>> has a 1-to-many relationship with MiddleThing, which also has a one-to-many 
>> relationship with BottomThing. 
>> (TopThing->1:*->MiddleThing->1:*->BottomThing). So we'd like navigation to 
>> follow that same idea of 
>> (/AppName/TopThing/{_Id}/MiddleThing/{_Id}/BottomThing). Is it possible to 
>> have this in web2py? If so, would some one care to explain? Thx.
>>
>>
>>

Reply via email to