Closed joshkersey closed 12 years ago
Hi, thanks for your patch! We're already working on a branch with Django 1.4 compatibility which solves it in a cleaner manner but your fix is great for now.
I'll merge your patch and release a 0.4.4. The new version 0.5 will deprecate the CropForeignKey and necessitate an admin class mixin for the same functionality. Cleaner, but some code changes necessary.
/cc @anrie
The signature for
ForeignKeyRawIdWidget.__init__()
in Django 1.4 is:The required argument
admin_site
is new to Django 1.4. Theformfield
method ofCropForeignKey
in fields.py doesn't include theadmin_site
argument:This patch inspects the arguments of
ForeignKeyRawIdWidget.__init__()
to see ifadmin_site
is a required argument and patches it into the__init__
kwargs forCropForeignKeyWidget
. If admin_site is required it uses django.contrib.admin.sites.site as the value.Could be argued whether this belongs in the Widget init or the CropForeignKey formfield.