On 8/5/06, Michael <[EMAIL PROTECTED]> wrote:
> Hello,
>
> From dajngo documentaytion:
>
>
>
> A choices list looks like this: YEAR_IN_SCHOOL_CHOICES = (
>  ('FR', 'Freshman'),
>  ('SO', 'Sophomore'),
>  ('JR', 'Junior'),
>  ('SR', 'Senior'),
>  ('GR', 'Graduate'),
> )
>
> Is it possible to have field with multiple choices in model like
>
> year=models.CharField(maxlength=2,
> multiplechoices=YEAR_IN_SCHOOL_CHOICES )?

Short answer: No.

Longer answer: This could be implemented with a custom model field
type, but that's a lot of work.

> The reason for that I have to write web front end for legacy application and
> they store multiple choices in DB as text field. Choices separated by new
> line.
> ManyToManyField not suitable for that case.

For just one field in just one application, I recommend treating it as
a regular text field and implementing your own rendering and
validation.

HTH,

Alan.

>
>  --
> --
> Michael
>  >
>


-- 
Alan Green
[EMAIL PROTECTED] - http://bright-green.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to