Set of choices of which several can be chosen without using a ManyToManyField

2011-11-01 Thread Jaroslav Dobrek
Hello, what is the most straightforward way to use a set of choices of which several can be chosen without using a ManyToManyField? Using a ManyToManyField would make my program unnecessarily complicated. Example: class Candidate(models.Model): programming_languages

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-01 Thread Tom Evans
On Tue, Nov 1, 2011 at 11:07 AM, Jaroslav Dobrek wrote: > Hello, > > what is the most straightforward way to use a set of choices of which > several can be chosen without using a ManyToManyField? > > Using a ManyToManyField would make my program unnecessarily > complicated. &

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-01 Thread Jaroslav Dobrek
> You are confusing model fields with form fields. MultipleChoiceField > is a form field, not a model field. I wasn't aware of the existence of MultipleChoiceFields. The idea of the above code was to express that I wanted to use this code class Candidate(models.Model): programming_languages

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-01 Thread Tom Evans
On Tue, Nov 1, 2011 at 1:05 PM, Jaroslav Dobrek wrote: >> You are confusing model fields with form fields. MultipleChoiceField >> is a form field, not a model field. > > I wasn't aware of the existence of MultipleChoiceFields. The idea of > the above code was to express that I wanted to use this c

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-01 Thread J. Cliff Dyer
On 11/01/2011 09:05 AM, Jaroslav Dobrek wrote: You are confusing model fields with form fields. MultipleChoiceField is a form field, not a model field. I wasn't aware of the existence of MultipleChoiceFields. The idea of the above code was to express that I wanted to use this code class Candida

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-02 Thread Mark Furbee
As alluded to previously, the most "straightforward way to use a set of choices of which several can be chosen" IS to use a ManyToManyField. The syntax is slightly different, but ManyToManyFields are really easy to use with Django. Do not reinvent the wheel in this case. Thanks, Mark Furbee On

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-02 Thread Jaroslav Dobrek
On 1 Nov., 18:54, Mark Furbee wrote: > As alluded to previously, the most "straightforward way to use a set of > choices of which several can be chosen" IS to use a ManyToManyField. The > syntax is slightly different, but ManyToManyFields are really easy to use > with Django. Do not reinvent the

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-02 Thread Tom Evans
On Wed, Nov 2, 2011 at 12:15 PM, Jaroslav Dobrek wrote: > I now use ManyToManyFields and hide certain data from administrators > by simply not importing them into admin.py. What I don't like about > this solution is that this data still is in the database and not in my > source code. In my view, i