/ Published in: Django
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
from django import forms from django.contrib.admin import widgets class ScheduleAdminForm(forms.ModelForm): profiles = forms.ModelMultipleChoiceField( widget = widgets.FilteredSelectMultiple('Profiles',False), queryset = Profile.active_objects.all(), help_text = "this doesn't show. bummer.") class Meta: model = Schedule class ScheduleAdmin(admin.ModelAdmin): form = ScheduleAdminForm admin.site.register(Schedule, ScheduleAdmin)
URL: http://snipt.net/mandric/modify-admin-field-to-use-specific-queryset-and-form-widget/