Hello, I've created a custom widget to replace the many to many widget found in the admin. Its working well, but I lose the "add" button when I use it. I see that the functionality is added by wrapping the widget in the RelatedFieldWidgetWrapper, but I can't figure out how to implement it. Essentially, my problem is the same as the user Julien who wrote to this group in 2007 under the subject "Popup 'add another' and custom widget in newforms-admin". (Actually I'm having the secondary problem he lists too, where form is still spitting back Validation errors even though the model specifies that this field is blank=True null=True)
I noticed this solution here: http://www.hoboes.com/Mimsy/hacks/replicating-djangos-admin/, but it seems like using the built in RelatedFieldWidgetWrapper would be the way to go to avoid any unexpected problems. My Form code looks like this: class EasyResourceAdminForm(forms.ModelForm): files = forms.ModelMultipleChoiceField(queryset=File.objects.none(), widget=MySelect) def __init__(self, *args, **kwargs): super(EasyResourceAdminForm, self).__init__(*args, **kwargs) self.fields['files'].queryset = File.objects.filter(resource=self.instance.pk) class Meta: model = Resource My AdminForm starts like this... class ResourceAdmin(admin.ModelAdmin): form = EasyResourceAdminForm MySelect is a subclass of SelectMultiple and implements custom render and render_options fields. I tried watching the execution from PDB in a few places, but I get lost quickly. Any ideas? Thanks, Justin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.