Hi folks,
I'd like to refactor the following code into one line in urls.py:

Now:
in `urls.py`:
+    (r'^watchlist/$',
'package.watchlist.views.rredirect_to_personalized_watch_list'),
+    (r'^users/(?P<username>.*)/watchlist/$',
'package.watchlist.views.watchlist'),

in `views.py`:
[EMAIL PROTECTED]
+def redirect_to_personalized_watch_list(request):
+    return HttpResponseRedirect('/users/%s/watchlist/' %
request.user.username)

I'm wondering how can I eliminate the need for the
`redirect_to_personalized_watch_list` and use django's `redirect_to`
generic view?  It'll be much easier if I could get `request` object in
the `urls.py`.

Thanks,
Alex


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to