tags:

views:

39

answers:

1

Given the following django URL conf. entry:

url(r'^(?P<obj_ctype_name>\w+)/(?P<obj_id>\d+)/$',
    views.obj_view,
    name='obj_view')

How would I rewrite the parameter (?P<obj_ctype_name>\w+) to enforce that it may only be one of "foo" "bar" or "baz" and still keep it as a named parameter?

+3  A: 

(?P<obj_ctype_name>foo|bar|baz)

Ben James