allow primary key to be non-numeric

This commit is contained in:
Craig Blaszczyk 2011-08-15 14:59:24 +01:00
parent 0d213f1439
commit eef995a21c

View File

@ -26,7 +26,7 @@ class ApiEntry(object):
)
elif issubclass(self.view, InstanceMixin):
urlpatterns = patterns('',
url(r'^%s%s/(?P<pk>[0-9]+)/$' % (url_prefix, self.resource_name),
url(r'^%s%s/(?P<pk>[0-9a-zA-Z]+)/$' % (url_prefix, self.resource_name),
self.view.as_view(resource=self.resource),
name=self.resource_name + '_change',
)