First, I want to thank you for sticking with me and helping me through
this. I've learned a lot, but unfortunately made no progress yet.
I read the links you sent and ended up trying this in forms.py:
from django.contrib import admin
class ProjectAdmin(admin.ModelAdmin):
formfield_overrides = {
models.CommaSeparatedIntegerField: {'widget':
forms.SelectMultiple},
}
but I get an error " 'module' object has no attribute 'ModelAdmin' "
(I verified this from python manage.py shell)
My guess is I'm using an older django distribution. Unfortunately,
this isn't something I can update since it's on a server I have
limited access to.
Before taking this tack, I was trying something like this (again, in
forms.py)
(
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-default-field-types
)
class ProjectForm(forms.ModelForm):
stains = forms.CommaSeparatedIntegerField
(widget=forms.SelectMultiple(choices=STAINS_CHOICES))
class Meta:
model = Project
...with this I get a strange error:
ViewDoesNotExist at /projectprofiler/admin/projects/project/504/
Tried logout_view in module projectprofiler.projects.views. Error was:
'module' object has no attribute 'CommaSeparatedIntegerField'
Request Method: GET
Request URL:
http://imageweb.broad.mit.edu:8081/projectprofiler/admin/projects/project/504/
Exception Type: ViewDoesNotExist
Exception Value: Tried logout_view in module
projectprofiler.projects.views. Error was: 'module' object has no
attribute 'CommaSeparatedIntegerField'
Exception Location: /imaging/analysis/People/imageweb/python-packages/
django/core/urlresolvers.py in _get_callback, line 184
...
In template /home/radon01/afraser/projectprofiler/templates/admin/
base.html, error at line 28
28 <a href="{% url projectprofiler.admin.views.main.password_change
%}">{% trans 'Change password' %}</a>
...I can't figure out what the password_change view as to do with the
commaseparatedintegerfield.
Thanks again :]
Adam
> ModelForms are discussed here:
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#topics-...
>
> Overriding the default field type for a field on a ModelForm is a bit
> further down:
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overrid...