On Friday, August 5, 2011 6:26:04 AM UTC-4, Francisco Costa wrote:
>
>
>
> On Aug 5, 12:54 am, pbreit <pbreit...@gmail.com> wrote: 
> > That should be easy to support. In default.py: 
> > 
> > def user(): 
> >     if request.args(0): 
> >         user = request.args(0) 
> >         ... 
> >     else: # list 
> >     ... 
> > 
> > def restaurant(): 
> >     if request.args(0): 
> >         restaurant = request.args(0) 
> >         ... 
> >     else:  # list 
> >     ... 
>
> and if you have them in different controllers? 
> I think that you should be able to define different default functions 
> for each controller in web2py
>
That would be a nice addition, but if the purpose of defining a default 
function is to hide it in the URL, then you can just use the same default 
function name in each controller -- since the name won't appear in the URL 
anyway, it's not too important what it is (from the end-user perspective).
 
In your case, can't you just set the default function to 'view' (the 
function you want to hide is called 'view' in both controllers)? Or set it 
to 'index', but move the 'view' functionality to the 'index' function, and 
then rename the current 'index' function to something else, such as 'list'.
 
Anthony
 

Reply via email to