Hi Norman, Thanks for the reply. I ended up just having two view functions and a common call to render_to_response. It's not quite as pretty as I was hoping for, but it will work just fine for this app.
Kind regards, Brandon On Sep 17, 1:53 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Brandon Taylor wrote: > > Hello everyone, > > > I'm using named paths as such: > > > url(r'^[-\w]+/(?P<page_slug>[-\w]+)/$', 'render_page', > > name='nested_page_link'), > > url(r'^(?P<page_slug>[-\w]+)/$', 'render_page', name='page_link'), > > > The only difference between these two urls is that some pages in this > > site can be nested under another page. So, I would like to be able to > > use one view action to render the page, as all I really need to pass > > to the action is the 'page_slug': > > > def render_page(request, *args, **kwargs): > > return render_to_response('dynamic_page.html', {'page_slug' : > > kwargs['page_slug']}) > > > But, this throws an error: > > > Reverse for 'crider_law.nested_page_link' with arguments '(u'who-we- > > are', u'how-we-are-different')' and keyword arguments '{}' not found. > > > What am I doing wrong? > > Do you use {% url %} tag in that template 'dynamic_page.html'? > > and I think it's better not to use *args, **kwargs unless there is a > good reason. They tend to hide bugs. > > def render_page(request, page_slug): > return render_to_response('dynamic_page.html', > {'page_slug':page_slug}) > > -- > Norman J. Harman Jr. > Senior Web Specialist, Austin American-Statesman > ___________________________________________________________________________ > Get off the sidelines and huddle up with the Statesman all season long > for complete high school, college and pro coverage in print and online! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---