I want to use both a slug and id to access my resources, so that the following urls would both point to the same resource
http://site.com/api/resource/this-is-the-slug
http://site.com/api/resource/35
I have added the following to my resource
prepend_urls(self):
return [
url(r"^(?P<resource_name>%s)/(?P<slug>[\w\d_.-]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name="api_dispatch_detail"),
]
Which gets the slug url working fine but unfortunately breaks the id url. How do I get both of them working together?