Re: [web2py] Re: Trying to reach a routes behavior

2016-03-29 Thread Carlos Cesar Caballero Díaz
Many thanks Anthony and Richard, I'll use your suggestion. Greetings. El 29/03/16 a las 10:27, Richard Vézina escribió: I agree with Anthony... Do you have any constraint that prevent you from doing that... I would definetly stay away from router as much as I can... Richard On Tue, Mar 29,

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-29 Thread Richard Vézina
I agree with Anthony... Do you have any constraint that prevent you from doing that... I would definetly stay away from router as much as I can... Richard On Tue, Mar 29, 2016 at 9:37 AM, Anthony wrote: > Right now the url to reach the index function of the country controller is >> something li

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-29 Thread Anthony
> > Right now the url to reach the index function of the country controller is > something like www.myapp.com/country/cuba because index is set as the > default function using the parametric router ( > www.myapp.com/country/index/cuba without set index() as default). > > Now I need to find a wa

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-29 Thread Carlos Cesar Caballero Díaz
Hi Anthony and Richard, these are the functions of my country controller (state and city controllers are similar): def index() def edit() In the future the controller will have more functions (we have planned new features that will be built as components) There is no a cuba() function, in in

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-28 Thread Anthony
On Monday, March 28, 2016 at 1:20:59 PM UTC-4, Carlos Cesar Caballero wrote: > > They provide related but different information with a different structure > (country show main country info, an basic States and Cities info and so > on), The separate country, city, and state controller files are no

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-28 Thread Richard Vézina
I don't understand Carlos, do you have a "cuba" controller/function in country/state/city controller files? Are you going to create a function for any given possible contry (+192)? There will be a lot of duplicated code... Why don't you have a location.py controller file with a contry/state/city f

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-28 Thread Carlos Cesar Caballero Díaz
They provide related but different information with a different structure (country show main country info, an basic States and Cities info and so on), The separate country, city, and state controller files are not strictly needed, but I prefer to maintain the code structure for extensibility an

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-28 Thread Anthony
What is the nature of these controllers and the functions they contain? Do you really need separate country, city, and state controller files, or could you instead have a single function in a single controller that retrieves data for a given country, city, state depending on the set of URL args

Re: [web2py] Re: Trying to reach a routes behavior

2016-03-28 Thread Carlos Cesar Caballero Díaz
Hi Antony, I was not clear enough... I have a country controller with a default index function, and the same with a state controller and a city controller, so right now: if I call www.myapp.com/country/cuba I get my country page for Cuba (the index function of country controller with cuba as p

[web2py] Re: Trying to reach a routes behavior

2016-03-28 Thread Anthony
I think there is some confusion of terminology. In web2py, a controller is a file in the /controllers folder, and each function in that file is an action reachable via an HTTP request. A view is not executed independently but associated with a particular function in a controller. With this term