On Fri, 2008-10-10 at 18:43 -0600, Jeff Anderson wrote: > Hello, > > So I'm working on a third party Django app, and we use a couple generic > views, specifically login and logout. > > For the urls.py in a project that uses our app, we do this: > > (r'^path', include(smug.urls), {'repo': 'docs'}) > > Our own views need the repo kwarg. This is something necessary for our > views to work. > > My question is how to get generic views to ignore this kwarg.
All keyword arguments are passed to the function as function arguments. So if you want to strip off an argument, write a wrapper function that accepts all the arguments you are passing in (possibly via **kwargs) and then removes the one(s) you don't want to pass to the generic view and then call the generic view. You'll need to write one such function (once) per generic view you call, since they're parameterised by the generic view they end up calling. [...] > We'd really rather use the generic views, but they seem a bit picky for > some of the crazy stuff we're doing. If by "picky" you mean that Python complains when you pass arguments to a function that aren't expected by that function, well, yes. But that's the way Python works. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---