views:

60

answers:

1

I was just pondering if make two named urls the same produces any problems. I tried it and it works. So for example, I have a view that is able to do paging:

def info(request, page_num = 1)

and I would like to call it both ways, as:

/info
/info/page/1

so I made urls like:

url(r'^info/$', 'views.info', name='info'),
url(r'^info/(?P<page_num>)\d+)/$', 'views.info', name='info'),

and it seems to work. Anything wrong with that, or should I name my second url differently, like info_paginated for example.

A: 

Nothing wrong with that and as far as I know pretty standard practice. I know I do it, mostly when I'm using URL's that integrate with Javascript code and I don't have the parameter to use on page load.

Bartek