diff --git a/docs/changelog.rst b/docs/changelog.rst index 4a55727..7bf7df6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,12 @@ Changelog ========== +In git master +------------- + +* Added ``pk_regex`` to the ``PolymorphicParentModelAdmin`` to support non-integer primary keys. + + Version 0.5.5 (2014-04-29) -------------------------- diff --git a/polymorphic/admin.py b/polymorphic/admin.py index ac5a817..2d1d13e 100644 --- a/polymorphic/admin.py +++ b/polymorphic/admin.py @@ -102,7 +102,10 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin): add_type_template = None add_type_form = PolymorphicModelChoiceForm - + + #: The regular expression to filter the primary key in the URL. + #: This accepts only numbers as defensive measure against catch-all URLs. + #: If your primary key consists of string values, update this regular expression. pk_regex = '(\d+)'