On 20 Jul 2012, at 12:03 PM, Bruno Rocha wrote:
> I dont know if it is a bug or feature (but I like it), you can do it in 
> models!

That works too, but you need be careful in your generation of outgoing URLs.

It might be best to check request.controller for known controllers (default, 
profile, appadmin, whatever) and just default to the group handler.

> 
> models/0_routing.py
> 
> if request.controller in MYLISTOFGROUPS:
>     groupslug = str(request.controller) # here you can use deep copy or just 
> str()
>     request.controller = 'group'
>     request.function = 'show'
>     request.args[0] = groupslug
> 
> 
> controllers/group.py
> 
> def show()
>     group = db(db.groups.slug==request.args(0)).select()
>      return dict(group=group)
> 
> 


-- 



Reply via email to