On Sep 30, 2011, at 8:52 AM, Marek Mollin wrote:

> I am trying to explicitly define what type of URL I wish to see.
> Since there are default route mappings I cannot figure why it always
> bounds index as default function even if I URL(c='something', f='') or
> URL(c='something', f=None).
> 
> As I understand second case for there is probably something
> underlaying that validates the urls and if no function then it
> appends. Yet when I excplictly say function should be empty?
> 
> I know I can try and read more about routing etc. But I would have to
> reorganize the whole thing to cut of the default function index... I
> think with the parametric URL it should assume I know what I am doing
> and let me rule the spectacle ;]]

URL() tests f thus: "if f:". So f='' and f=None are treated the same way. 

If f is not specified (both your examples), URL() defaults to the current 
function (the function associated with the current request), not necessarily 
index. 

If you want to get rid of the function in the resulting URL, enable the 
parametric router and specify whatever the default function is for the 
app/controller combination. The router will omit the function name if it can do 
so unambiguously. 

Reply via email to