Hello,
This should be a pretty simple question. I have a list of options:
STAIN_CHOICES = (
(1, 'DNA - DAPI'),
(2, 'DNA - Hoechst'),
(3, 'DNA - other'),
(4, 'Actin - Phalloidin'),
(5, 'Tubulin'),
)
I would like users to be able to select more than one of these things
at a t
Hi.
I haven't played much around with this kind of thing, but I
would suggest that you take a look at the form widgets.
One of them is called, SelectMultiple, which I bet is the one
you are after, but I'm not sure if it will work with choices.
You can find something about it at
http://docs.django
I don't see anything called SelectMultiple on the page you linked.
That was the page I've been scouring for a while now looking for a way
to do this. The ModelMultipleChoiceField looks promising, but
apparently it's associated with a ManyToManyField model, and that
doesn't really fit what I'm goi
On Mar 23, 1:49 pm, Adam Fraser wrote:
> Hello,
>
> This should be a pretty simple question. I have a list of options:
>
> STAIN_CHOICES = (
> (1, 'DNA - DAPI'),
> (2, 'DNA - Hoechst'),
> (3, 'DNA - other'),
> (4, 'Actin - Phalloidin'),
> (5, 'Tubulin'),
> )
>
> I would like
I found the SelectMultiple widget here:
http://docs.djangoproject.com/en/dev/ref/forms/widgets/
But I still don't know how to hook that up to a model like
CommaSeparatedIntegerField.
help?
On Mar 23, 3:25 pm, Adam Fraser wrote:
> I don't see anything called SelectMultiple on the page you link
On Mar 23, 3:36 pm, Adam Fraser wrote:
> I found the SelectMultiple widget here:
>
> http://docs.djangoproject.com/en/dev/ref/forms/widgets/
>
> But I still don't know how to hook that up to a model like
> CommaSeparatedIntegerField.
>
> help?
>
Did you try something like this? This is off the t
Still doesn't work. Maybe I should be more specific.
I'm editing projectprofiler/projects/models.py which hasn't needed to
import forms for anything, and when I do I get very strange errors.
Here's what it looks like now:
from django.db import models
from django.contrib.auth.models import User
On Mar 24, 8:55 am, Adam Fraser wrote:
> Still doesn't work. Maybe I should be more specific.
>
> I'm editing projectprofiler/projects/models.py which hasn't needed to
> import forms for anything, and when I do I get very strange errors.
>
> Here's what it looks like now:
>
> from django.db impo
hrm, I think I'm _finally_ starting to understand how django is meant
to be used.
Question: Why can't I just specify the widget used by a particular
field from my model in the admin interface.
stains = models.CommaSeparatedIntegerField(widget=SelectMultiple
(choices=STAIN_CHOICES))
...or can I?
On Mar 26, 9:59 am, Adam Fraser wrote:
> hrm, I think I'm _finally_ starting to understand how django is meant
> to be used.
>
> Question: Why can't I just specify the widget used by a particular
> field from my model in the admin interface.
>
> stains = models.CommaSeparatedIntegerField(widget=S
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
Does anyone have a clue why I can't access ModelAdmin in
django.contrib.admin?
>>> from django.contrib import admin
>>> dir(admin)
['__builtins__', '__doc__', '__file__', '__name__', '__path__',
'models']
???
I'm trying to do this:
class ProjectAdmin(admin.ModelAdmin):
formfield_overrides
On Mon, Apr 6, 2009 at 1:40 PM, Adam Fraser wrote:
>
> Yeah, I just realized I'm running django 0.97
>
> On Apr 6, 1:32 pm, Karen Tracey wrote:
> > On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser >wrote:
> >
> >
> >
> > > Does anyone have a clue why I can't access ModelAdmin in
> > > django.contri
On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser wrote:
>
> Does anyone have a clue why I can't access ModelAdmin in
> django.contrib.admin?
>
> >>> from django.contrib import admin
> >>> dir(admin)
> ['__builtins__', '__doc__', '__file__', '__name__', '__path__',
> 'models']
>
> ???
>
That's the res
Yeah, I just realized I'm running django 0.97
On Apr 6, 1:32 pm, Karen Tracey wrote:
> On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser wrote:
>
>
>
> > Does anyone have a clue why I can't access ModelAdmin in
> > django.contrib.admin?
>
> > >>> from django.contrib import admin
> > >>> dir(admin)
>
Yup:
>>> django.get_version()
u'0.97-pre-SVN-unknown'
On Apr 6, 1:45 pm, Alex Gaynor wrote:
> On Mon, Apr 6, 2009 at 1:40 PM, Adam Fraser wrote:
>
> > Yeah, I just realized I'm running django 0.97
>
> > On Apr 6, 1:32 pm, Karen Tracey wrote:
> > > On Mon, Apr 6, 2009 at 11:57 AM, Adam Fraser
Adam, did you solve you problem?
I try to solve the same problem here
http://stackoverflow.com/questions/723639/forms-selectmultiple-from-models-commaseparatedintegerfield
On Apr 7, 5:47 pm, Adam Fraser wrote:
> Yup:>>> django.get_version()
>
> u'0.97-pre-SVN-unknown'
>
> On Apr 6, 1:45 pm, Al
17 matches
Mail list logo