In djangoproject link its this example...

MEDIA_CHOICES = (
    ('Audio', (
            ('vinyl', 'Vinyl'),
            ('cd', 'CD'),
        )
    ),
    ('Video', (
            ('vhs', 'VHS Tape'),
            ('dvd', 'DVD'),
        )
    ),
    ('unknown', 'Unknown'),
)

Maybe you can use something like this:

YOUR_CHOICES = (
       ('haircolor', (
               ('blond', 'Blond'),
               ('black', 'Black),
            )
       ),

       ('skincolor', (
                ('white', 'White'),
                ('black', 'Black'),
            )
       ),

       ('Gender', (
                ('male', 'Male'),
                ('female', 'Female'),
            )
       ),
)

However, if you need dinamic choices use foreignkeys, if you need to many
foreignkeys for your choices why not think in categories or tags... so
design a m2m model

On my work have to catalog business contacts... i design a Contacts Model,
a Categories Model and a model in the middle so a Contact can have one or
more Categories.
Lets say that John Doe can have the next list of categories 'Brown Hair
Color', 'White Skin Color', 'Blue Eyes Color', 'Male Sex'...




2013/8/21 Gerd Koetje <deonlinefotogr...@gmail.com>

> im building a prety complicated user detail form with all kinds of fields,
> like:  gender,haircolor,skincolor
>
> some fields have to become dropdowns with only 1 choise out of many
> and some fields have to become multiple select fields with alot of choise
> (multiple choises allowed)
> I was trying to use 1 model that holds all the values for each field, but
> it seem to only work if i make a model for each field values
>
> the dropdowns seem to work ok with foreignkey
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to