sehmaschine/django-grappelli — Issue #80: ManyToManyField as Checkbox
Author: fetzig
Created: 2012-02-01 16:59:45+00:00
State: open

Setup a ModelAdmin like this:

class SomeModelAdmin(admin.ModelAdmin):
formfield_overrides = {
models.ManyToManyField: {'widget': CheckboxSelectMultiple},
}
....

Go to the change_form of this model and click the "+" button at the end of the checkboxes of one ManyToManyField to create a new model to reference with. a popup opens (as usual).

fill out form -> hit save -> model instance is saved but popup doesn't close because of a javascript error.

seems like the javascript is looking for a selectbox:
Uncaught ReferenceError: SelectBox is not defined
dismissAddAnotherPopup:8000/static/admin/js/admin/RelatedObjectLookups.js:137
(anonymous function)
https://github.com/sehmaschine/django-grappelli/blob/master/grappelli/static/grappelli/js/admin/RelatedObjectLookups.js#L137