From 1ff5f148b65d5ec36f556716a7db2f3af38b287d Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Thu, 30 Apr 2015 11:39:13 +0200 Subject: [PATCH] Fixed Django 1.8 support for related field widgets. The RelatedFieldWidgetWrapper tries to resolve the "change" url with "__fk__" as ID value, which broke with our strict pk_regex --- docs/changelog.rst | 6 ++++++ polymorphic/admin.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 714482d..e67f2ea 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,12 @@ Changelog ========== +Version 0.7.1 (2015-04/30) +-------------------------- + +* Fixed Django 1.8 support for related field widgets. + + Version 0.7 (2015-04-08) ------------------------ diff --git a/polymorphic/admin.py b/polymorphic/admin.py index ec4c302..310a6b8 100644 --- a/polymorphic/admin.py +++ b/polymorphic/admin.py @@ -120,7 +120,7 @@ class PolymorphicParentModelAdmin(admin.ModelAdmin): #: 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+)' + pk_regex = '(\d+|__fk__)' def __init__(self, model, admin_site, *args, **kwargs):