You have passed 'anything' as a keyword argument that will get passed into your view. Unfortunately, you can't access it in your inline constructor call. Try subclassing RedirectView in views.py of your app.
class SubRedirectView(RedirectView): query_string = True def get_redirect_url(self, **kwargs): return '/tmovil/planes/%s' % self.kwargs.get('anything', None) ~Drew On Mon, May 14, 2012 at 2:30 PM, Sławek Ehlert <slaf...@gmail.com> wrote: > As the error states: > You don't have a format argument in your '/tmovil/planes/%(anything)s' > string. > > Cheers > > Dnia 14.05.2012 23:19, Germán napisał(a): > > Hi. Please excuse my ignorance in this affairs. > > For an specific > URI<http://www.lookup.cl/planes/?page=3&_ult=sec%3Dweb%26slk%3Dweb%26pos%3D4%26linkstr%3Dhttp%253A%252F%252Fwww.lookup.cl%252Fplanes%252F%253Fpage%253D3%26csec%3D%26cpos%3D%26concept%3D%26query%3Dvirgin%2Bmovil%2Bplanes%2Ben%2Bchile%26cbid%3D&_ult_url_params=csec%3D%26sec%3Dweb%26slk%3Dweb%26cpos%3D%26pos%3D4%26concept%3D%26query%3Dvirgin%2Bmovil%2Bplanes%2Ben%2Bchile%26cbid%3D>, > I have the following error > > Traceback (most recent call last): > > > > File > "/usr/local/lib/python2.6/**dist-packages/django/core/**handlers/base.py", > line 111, in get_response > response = callback(request, *callback_args, **callback_kwargs) > > File > "/usr/local/lib/python2.6/**dist-packages/django/views/**generic/base.py", > line 47, in view > return self.dispatch(request, *args, **kwargs) > > File > "/usr/local/lib/python2.6/**dist-packages/django/views/**generic/base.py", > line 68, in dispatch > return handler(request, *args, **kwargs) > > File > "/usr/local/lib/python2.6/**dist-packages/django/views/**generic/base.py", > line 151, in get > url = self.get_redirect_url(****kwargs) > > File > "/usr/local/lib/python2.6/**dist-packages/django/views/**generic/base.py", > line 146, in get_redirect_url > return url % kwargs > > TypeError: not enough arguments for format string > > > The version I use is 1.3.1, and the urls.py line determining the > redirection is > > > (r'^planes/((?P<anything>.*))', > RedirectView.as_view(url='/tmovil/planes/%(anything)s', query_string=True)), > > > Is it possible the bug reported in ticket > 16842<https://code.djangoproject.com/ticket/16842>is cause for this error? If > not, should I file a bug? > > Thanks > > On Saturday, August 13, 2011 12:47:30 AM UTC-4, Karen Tracey wrote: >> >> On Thu, Aug 11, 2011 at 10:48 AM, Slafs wrote: >> >>> Should i report a ticket? >>> >> >> Yes please, that's a bug in Django. >> >> Karen >> -- >> http://tracey.org/kmt/ >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/SebYILZBuMAJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- > 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.