> What does that mean exactly? You can have multiple RESTful controllers, and
> they can call functions defined elsewhere if necessary.

Just taking the sample code in the docs as an example  You have the
patterns, the magic sauce in parse_as_rest(), then the db object
passes the results to the parser.response or raises an Error. So if
you wanted to split that up you first would have to know which of the
patterns was hit, then have a switch type of structure to pass
processing the the result set to the proper party.


>
>>
>> 2) it blurs the separation of routing and application level logic
>
>
> What problems does this cause? How would you prefer to do it?


I'm very much of the belief of separation of responsibilities. Maybe
by convention it could search for the tuples in
<model>/url_patterns.py?

>
>>
>> 3) it doesn't allow for granular access/authorization checks
>
>
> Do you have an example? Note, you don't have to control access via
> decorators only -- you can check permissions within the method logic as
> well.
>

Imagine that the user requesting /friend/Joe/Pets had access to Joe,
but not to his pet list or, for instance,
.../friend/Joe/Pets/Jeets/breed the user had access to the his friend
Joes's pets, but not their breed. How would you enforce that in this
case? Honest question because as I've said before I'm fairly new to
web2py


> Anyway, if you can provide more specific suggestions for how it could be
> made more useful (i.e., what should the API look like), maybe it can be
> improved.
>
> Anthony

Reply via email to