On Thu, Dec 3, 2009 at 2:37 AM, Todd Blanchard <tblanch...@mac.com> wrote:
> I think you've kind of missed my point as there's not a view that can render
> any object - but rather the name of the view is in the url.

my 2 cents:

first of all, if you want Rails, you know where to find it.  i (and
several others, i guess) like Django in part because it's *not* Rails.
 :-)

second, remember that Python is a dynamic language, you can use Python
to create most things that usually you write directly.  specifically,
it would be reasonably easy to write something like this (untested):

urlpatterns += patterns('',
   *[ (r'/app/%s/(?P<id>[^/]+)/' % v.__name__, v) for v in (view1,
view2, view3)])


in short: this creates a list of tuples (url, function) where the url
is built using the function's name.  the list is then unrolled to the
patterns() call.

-- 
Javier

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to