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?
(?P<obj_ctype_name>foo|bar|baz)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With